Don’t overuse hashtag. Use it wisely:
- Twitter: use 2 hashtags only to boost performance
- Instagram: use 11 hashtags is optimal
- Facebook: no need to use hashtag, use it might reduce view reach. If have to use, just 2 at most
Don’t overuse hashtag. Use it wisely:
1. Ran a series of tests that verified Google is able to execute and index JavaScript with a multitude of implementations. Confirmed Google is able to render the entire page and read the DOM, thereby indexing dynamically generated content.
2. SEO signals in the DOM (page titles, meta descriptions, canonical tags, meta robots tags, etc.) are respected. Content dynamically inserted in the DOM is also crawlable and indexable. Furthermore, in certain cases, the DOM signals may even take precedence over contradictory statements in HTML source code. This will need more work, but was the case for several of our tests.
Read more here: http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157
Open a New Tab
Press F12 to open Web Developer Tool
Open Console tab
Paste these code, and press ENTER to run:
chrome.tabs.query({}, function(tabs) { var firstSee = []; for (var i = 0; i < tabs.length; i++) { var url = tabs[i].url; var id = tabs[i].id; if (firstSee.indexOf(url) >= 0){ chrome.tabs.remove(id); } else{ firstSee.push(url); } } })
javascript:chrome.tabs.query({}, function(tabs) {var firstSee = [];for (var i = 0; i < tabs.length; i++) {var url = tabs[i].url;var id = tabs[i].id;if (firstSee.indexOf(url) >= 0){chrome.tabs.remove(id);} else{firstSee.push(url);}}})
Then open a New Tab, click that Bookmarklet. Done!
Attributes are in your HTML text document/file, whereas properties are in HTML DOM tree.
Attributes are static, whereas properties are dynamic (can be change by your JS code).
When developing with Responsive web design (RWD), you should use these CSS3 feature
See more here
Vì sao?
Một số công nghệ web đã trưởng thành và sẽ được triển khai trên nhiều trang web, mang lại nhiều ấn tượng cho user, giảm công sức cho lập trình viên khi phát triển và phân phối ứng dụng
CSS filters, mang sức mạnh đồ hoạ 3D
Cho phép thực hiện nhiều hiệu ứng đồ hoạ phức tạp (làm mờ, đổ bóng, bóp mép, đổi hình dạng của đối tượng, thay đổi mật độ màu, …) bằng các khai báo đơn giản.
Cho phép thực hiện các thao tác đồ hoạ phức tạp như đổ bóng vertex (như dùng GLSL, được ứng dụng phổ biến nhiều năm nay trong các xử lý đồ hoạ 3D)
Xem ví dụ tại CSS Filter
Lợi ích lớn cho các game nền web, các ứng dụng cần những hiệu ứng gây shock về đồ hoạ, xử lý ảnh
Google ko đối đầu trực tiếp với Windows, Mac, Linux, mà họ tạo ra Chrome, cố gắng làm cho Chrome có mặt tại nhiều nơi, nhiều thiết bị như TV, laptop, điện thoại
Với Chrome, Google mang lại cho các lập trình viên khả năng viết chương trình bằng JS HTML CSS (là đơn giản hơn nhiều so với việc viết bằng C# Java PHP), chạy chương trình trong Chrome.
Hiện tại, viết extension/app cho Chrome là dễ nhất, nhanh nhất và thuận tiện nhất (so với việc viết cho Firefox, IE, Opera)
ECMAScript 6 (ES6), là cải tiến của JavaScript, sửa các vấn đề “chíu khọ” trong ngôn ngữ JavaScript, cung cấp tính năng mới thuận tiện hơn, dễ bảo trì mã nguồn hơn.
Web Components cho ta khả năng thêm tag mới cho trình duyệt, tương tự như những tag gốc sẵn có. VD:
Web Components sẽ thay đổi cách viết, sử dụng và phân phối các thư viện JavaScript hiện có theo hướng dễ dàng hơn nhiều.
Các tính năng mới, API mới sẽ được (tự động) đưa vào trình duyệt mới ngày càng nhanh hơn
– Remote desktop to your server (e.g.: with username = YourUserLockeVN)
– On server, download dropbox.exe to C:\
– Start command prompt (with “YourUserLockeVN” please, the idea is dropbox will be installed under this account credential and its role/right)
– Install dropbox by command prompt:
"C:\dropbox.exe" /D=C:\Program Files\Dropbox
– Run through DropBox setup, login to dropbox, use advanced install, determine local folder for sync, …
– (very important) Start Dropbox, Preferences -> uncheck “Show desktop notifications” and “Start Dropbox on system startup”
– Exit dropbox (right click tray icon, Exit)
– Check StartMenu/Startup folder, remove the Dropbox shortcut (if any)
– Download Windows Server 2003 Resource Kit Files (Win2003, 2008 can use)
– Install it into your server (don’t worry about conflict, they are all M$ stuff, and they just extracts to folder)
– on command prompt, create Service by:
"C:\Program Files (x86)\Windows Resource Kits\Tools\instsrv" DropBoxService "C:\Program Files (x86)\Windows Resource Kits\Tools\srvany.exe"
– Start/Run, “Regedit”, go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DropBoxService
– Create KEY Parameters
– Create String value name “Application“, value C:\Program Files\Dropbox\Dropbox.exe /home
– Create String value name “AppDirectory“, value C:\Program Files\Dropbox
– Go to Administration Tools / Services -> DropBoxService -> Properties -> Log on -> Use “YourUserLockeVN”
– Change the service startup type to “Automatic”
– Start service
That’s fine. Now you can logoff, disconnect from the server and Dropbox still up and running, sync your file.
I found this Javascript sleep function here and it works in FF9, Chrome 14 (tested).
function sleep(ms) { ms += new Date().getTime(); while (new Date() < ms){} }
This function will block browser from doing anything, even setTimeout()
E.g.:
/*BEGIN*/ setTimeout(alert('stupid'), 1000); sleep(2000); // after sleep completed, setTimeout has its turn to run. // The alert() will be shown after 3 seconds from /*BEGIN*/
This might be a stupid thing but sometimes you have to do stupid work and it’s required.
This is my sum up about NodeJS on July 2011, base on some slides (of geeks in my list from BarCamp Saigon 2011). Just a fastfood of what NodeJS is, why is get buzz at the moment.
The System.Web.UI.Page class contains two methods for emitting client-side script code into the HTML rendered by the ASP.NET Web page:
Both of these methods take two strings as input. The second parameter, script, is the client-side script—including the opening and closing <script>
tags—to insert into the page. The first parameter, key, serves as a unique identifier for the inserted client-side script.
The only difference between these two methods is where each one emits the script block. RegisterClientScriptBlock()
emits the script block at the beginning of the Web Form (right after the <form runat="server">
tag), while RegisterStartupScript()
emits the script block at the end of the Web Form (right before the </form>
tag).
By default, animations are queued, but you can disable this by setting the queue
property to false
. Unqueued animations start immediately and subsequent queued animations are not deferred for unqueued animations.
$("img").fadeIn(500)
.animate({"width":"+=100"},
{queue:false, duration:1000})
.fadeOut(500);
fadeIn()
and fadeOut()
effects are queued, but the call to animate()
(which animates the width
property for 1000ms) is not queued.fadeIn()
effect begins. The fadeOut()
effect begins as soon as the fadeIn()
effect ends—it does not wait for the width animation to complete.
You probably already know that you can pass a tagname to $()
to create an element of that type, and that you can pass (as a second argument) an object of attributes to be set on the newly created element.
attr()
method, var image = $("<img>", {
src: image_url,
alt: image_description,
className: "translucent_image",
click: function() {$(this).css("opacity", "50%");},
css: { border: "dotted red 3px" }
});
Sum up from: http://answers.oreilly.com/topic/2353-5-things-you-might-not-know-about-jquery/
This article is in my FASTFOOD series:
Millions of people around the world have disabilities that hinges them from information.
If you care about a web truly accessible to people w/disabilities, follow @googleaccess team, on the forefront of alt access modes. They are active!
http://www.1stwebdesigner.com/design/web-accessibility-guide-beginners/
http://www.google.com/accessibility/
I was developing a DemoSite and have problem with IE7 (actually we’re only target IE8, but one of our module must run in IE8 emulate IE7 mode so a meta tag <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE7″ /> is put in the header). While Firefox is my primary browser and it’s OK with display: inline-block CSS style, BUT IE7 (and IE8EmulateIE7) does not render it.
So this is the hack for IE7 (from http://grasshopperpebbles.com/css/css-inline-block-ie7-hack/):
HTML
<div class="predefinedList"> <div class="predefinedListItem">Cross country skiing</div> <div class="predefinedListItem">Fine cuisine</div> <div class="predefinedListItem">Spa</div> </div>
Put your style settings to the top,
put display: inline-block;zoom:1;*display:inline; to the bottom.
CSS
.predefinedList .predefinedListItem { padding:0; /* other the styles should be here */ display:inline-block; /* for firefox */ zoom: 1; /* for IE7 hack */ *display:inline; /* for IE7 hack */ }
Sometime while working with EPiServer, you have to know current page is viewed in EditMode or ViewMode. Let’s check the CurrentPage.WorkPageID property of that page’s PageData.
If WorkPageID = 0, it means that this page is viewing in ViewMode.
This is step – by – step procedure (with sample):
[xdebug]
php_xdebug-2.0.5-5.3-vc6.dll
zend_extension_ts="c:/wamp/php/ext/"
xdebug.profiler_output_dir = "c:/wamp/tmp/xdebug"
xdebug.profiler_output_name = "cachegrind.out.%p"
xdebug.profiler_enable = 0
xdebug.profiler_append=0
xdebug.extended_info=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey=xdebug
xdebug.remote_log="c:/wamp/tmp/xdebug/xdebug_remot.log"
xdebug.show_exception_trace=0
xdebug.show_local_vars=9
xdebug.show_mem_delta=0
xdebug.trace_format=0
Buzz is more “seem-to-be-right” than Wave.
MOST important: Use Buzz in Gmail, an everyday-should-open-address.
Buzz and Wave are different services, carry different objectives of Google, Twitter copycat vs. real-time collaborations. Big problem of Wave is that it wasn’t integrated into Gmail, so I have to open new tab in browser, type new strange address and hit enter, what I don’t like.
Every Google’s user has Gmail along with its address book, and Gmail is a place for people to COMPOSE something (write mail, chat, …), others are READ-oriented services. Whenever I want to share or talk or collaborate (using Google service), I type “gmail”, [enter]
And the other things that I think Buzz will be OK are:
(this is a string)
EPiServer.Framework.Initialization.SiteMappingConfiguration.Instance.SiteId
reference your project to EPiServer.Framework.dll
EPiServer.Web.SiteDefinition.CurrentOrDefault.Id
(Guid type)
reference your project to EPiServer.dll
EPiServer is the world’s fastest growing provider of Web Content Management (WCM) and online social community platforms. Over 3000 customers worldwide use EPiServer CMS to create collaborative, engaging and attractive websites. The platform EPiServer CMS is the foundation of more than 9000 websites and is used on a daily basis by over 130,000 web editors. It enables true web engagement which allows customers to turn passive web visits into dynamic, personalized web experiences that drive new revenues. EPiServer delivers its WCM platform through a network of more than 340 competent partner companies in 25 countries.
Founded in 1994, the company has offices in the USA, Sweden Denmark, Norway, Finland, the Netherlands, Australia, South Africa and the UK.
Attached to this mail you will find five different profiles,
As the Development Manager coming to Hanoi on the January the 22 it is important for candidates to apply ASAP.
Send your CV to pelle[dot]niklasson[at]episerver.com
Bitwise operators give you the ability to store multiple settings in a single primitive data type (e.g. an integer). This is useful when a single item has potentially more than one setting of the same type.
EPiServer AccessLevel is enum, and if you want to set or remove a AccessLevel, we need to use bitwise operators:
To start of with, declare an enum to list all the possible flags. Two things are important when declaring the enum. The first thing you will probably notice is the [Flags] attribute. This is necessary in order to indicate that the enumeration should be treated as a set of flags. The second important thing is assigning a value to each of the items in the enum. The first value should be 1, then just double the value for each consecutive item. The integer type in .NET can store up to 32 flags.
EPiServer.Security { // Summary: // The access levels (bitmapped) that are used to control the various actions // that a user is allowed to perform. // // Remarks: // Primarily used to control access to page manipulation functions in EPiServer, // but can be used for general-purpose access restriction functions. [Serializable] [Flags] public enum AccessLevel
To set multiple flags, concatenate the desired flags using the bitwise OR symbol “|”:
pageACL.Access |= AccessLevel.Delete;
pageACL.Access &= ~AccessLevel.Delete;
if ((pageACL.Access&AccessLevel.Delete)==AccessLevel.Delete)
PageData data = DataFactory.Instance.GetPage(e.PageLink); // this page also cannot delete, ignore processing if (data.QueryDistinctAccess(AccessLevel.Delete) == false) { return; } // modify this page accessright, do not allow to delete AccessControlList list = data.ACL.CreateWritableClone(); foreach (KeyValuePair<string, AccessControlEntry> pair in data.ACL) { if ((pair.Value.Access & AccessLevel.FullAccess) == AccessLevel.FullAccess) { list.Remove(pair.Key); list.Add(new AccessControlEntry(pair.Value.Name, pair.Value.Access & ~AccessLevel.FullAccess, pair.Value.EntityType)); } if ((pair.Value.Access & AccessLevel.Delete) == AccessLevel.Delete) { list.Remove(pair.Key); list.Add(new AccessControlEntry(pair.Value.Name, pair.Value.Access & ~AccessLevel.Delete, pair.Value.EntityType)); } } list.Save(SecuritySaveType.Modify);
Bài này đề cập tới DataCaching của ASP.NET. Các vấn đề outputCaching (cache cả trang aspx) và fragmentCaching (cache một ascx, một phần của trang Aspx) là khá dễ, chỉ cần setup vài thẻ trong mã aspx là xong nên không được đề cập trong bài.
Xem thêm tại http://aspnet.4guysfromrolla.com/articles/022802-1.aspx
Cache về bản chất giống như một HashTable, lưu key là một String, value là đối tượng .NET. Tuy nhiên Cache thì có tính năng đặc biệt là tự động gỡ bỏ các entry theo thời gian hoặc khi hết bộ nhớ để lưu.
Truy xuất Cache:
dùng đối tượng tĩnh HttpContext.Current.Cache
nếu trong Page aspx, dùng Server.Cache
nếu trong ashx, dùng context.Cache
tất cả đều truy xuất đến cùng một chỗ lưu cache của ASP.NET.
Có hai kiểu chính sách hết hiệu lực bạn có thể sử dụng khi lưu giữ dữ liệu trong cache.
Cache.Insert("cacheKey", ObjectToCache, null, DateTime.Now.AddMinutes(10), TimeSpan.Zero);
Cache.Insert("cacheKey", ObjectToCache, null,DateTime.MaxValue, TimeSpan.FromMinutes(10));
Mẫu code chung để sử dụng Cache là:
T GetValue(){
string CACHE_KEY = "cacheKey";
object oValue = cache[CACHE_KEY];
if (oValue == null) {
oValue = GetValueFromSomeWhere();
// Lưu giữ đối tượng theo kiểu nào tuỳ bạn chọn
cache.Insert(CACHE_KEY, oValue, null, DateTime.MaxValue, TimeSpan.FromSeconds(60));
}
return oValue as T;
}
Hàm GetValueFromSomeWhere() là chỗ bạn lấy dữ liệu thực ở đâu đó (VD lấy từ Database, đọc từ file …)
.
Một số bonus:
Hàm Cache.Insert() có đối số cuối cùng là CallBack. Tính năng này khá tiện, cho phép developer kiểm soát xem nên làm gì mỗi khi Cache entry bị gỡ bỏ (có thể kiểm tra, tạo lại mới luôn, hoặc thực hiện một số tác vụ …) . Tips: Dùng cái này có thể tránh được việc pooling để kiểm tra xem Cache entry hết hạn chưa.
Callback này không được khởi chạy nếu cache entry bị gỡ bỏ có chủ ý (bằng cách gọi Remove(), hay gọi Insert() mới đè lên)
Hàm Cache.Insert() nếu cung cấp key trùng với key đã có rồi sẽ gỡ bỏ entry cũ, ấn entry mới vào với key tương ứng ấy