Skip to content

Instantly share code, notes, and snippets.

View Edarlingen's full-sized avatar

Aleksey Karagodnikov Edarlingen

  • Russian Federation
View GitHub Profile
###[Q] Форматирование
Чтобы отформатировать код, выделите его мышью и нажмите на кнопку `{}` редактора.
###[Q] Работа за автора
Согласно правилам форума, вопросы не должны сводиться к решению либо завершению учебных заданий за учащихся. Пожалуйста, уточните, что вы сделали сами и что не получилось.
###[Q] Примите ответ
Если вам дан исчерпывающий ответ, отметьте его как верный (нажмите на галку рядом с выбранным ответом).
###[Q] Всеобъемлющий вопрос
@lttlrck
lttlrck / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@jayeb
jayeb / jquery.transitionduration.js
Created March 3, 2013 22:08
jQuery plugin for easily parsing an element's CSS transition duration
(function($){
$.fn.transitionDuration = function() {
var d = $(this).css("transitionDuration") || "0s";
return (parseFloat(d) * (/ms/.test(d)?1:1000)).toFixed(0);
}
})(jQuery);
@jlong
jlong / uri.js
Created April 20, 2012 13:29
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"