JavaScript сниппеты в Chrome

Еще одна прекрасная вещь внезапно обнаруженная мной в Chrome – это возможность создания JavaScript сниппетов – кусочков кода, которые можно будет выполнить в любой момент на странице.

Continue reading

ng-biscuit – cookies extension for AngularJS

ng-biscuit

If you work with AngularJS a lot you probably know that when you want to use cookies with all the options like domain, path, etc… you face with lack of functionality in native Angular ngCookies module. It’s almost 3 years when this issue has been reported.

So I’ve created my module – ng-biscuit to deal with cookie options.

There is also alternative by Dmitri Voronianski by name ngKookies which is port of jquery-cookie.

JavaScript for detecting browser language preference

Just not to forget:

[javascript]
var language = window.navigator.userLanguage || window.navigator.languages[0];
[/javascript]

and more crazy(but more trustful) way:

[javascript]
$.ajax({
url: "http://ajaxhttpheaders.appspot.com",
dataType: ‘jsonp’,
success: function(headers) {
var language = headers[‘Accept-Language’];
}
});
[/javascript]