Skip to content

Instantly share code, notes, and snippets.

View r-isayev-parc's full-sized avatar

r-isayev-parc

View GitHub Profile
###
Роутинг приложения
###
App.Router.map () ->
@resource "index", path: "/practice", () ->
@route "index"
@resource "selection", path: "/selections/:selection_id", () ->
@route "index"
@resource "folder", path: "/folders/:folder_id", () ->
@resource "folder_documents", path: "/documents", () ->
@r-isayev-parc
r-isayev-parc / old_code.js
Created July 3, 2012 10:47
Оптимизация создания DOM элементов
loadingPageDocuments: function(customCount) {
var loader = $('<li class="b-load"><div class="b-borders"></div></li>'),
count = customCount || this.perPage,
container = $('#relations_page');
for (var i = 0; i < count; i++) {
container.append(loader.clone());
}
},
avatarCreateCash: function() {
var items = $('.js-feed-item').find('.js-feed-item-icon-content');
this.iconAvatarCash = [];
for (var i=0, len = items.length; i < len; i++) {
this.iconAvatarCash.push(items.eq(i));
}
},
@r-isayev-parc
r-isayev-parc / uri.js
Created April 24, 2012 04:02 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@r-isayev-parc
r-isayev-parc / social.js
Created November 30, 2011 11:32 — forked from meritt/social.js
Асинхронное подключение Google Analytics, Google +1, Facebook SDK, Twitter Widgets и Вконтакте API
(function(window, document) {
window.___gcfg = { // Настройки языка для Google +1 Button
lang: 'ru'
};
window._gaq = [ // Настройки Google Analytics
['_setAccount', 'UA-XXXXXX-1'],
['_trackPageview'],
['_trackPageLoadTime']
];