Colors of social brands is [here][2]
Facebook Share
http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwebsite.com&t=url%20encoded%20text
Facebook Like Button
http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwebsite.com
# Use Gists to store entire functions | |
class QuickSort | |
def self.sort!(keys) | |
quick(keys,0,keys.size-1) | |
end | |
private | |
def self.quick(keys, left, right) |
/** | |
* Fast method | |
*/ | |
function shift(arr, direction, n) { | |
var times = n > arr.length ? n % arr.length : n; | |
return arr.concat(arr.splice(0, (direction > 0 ? arr.length - times : times))); | |
} | |
/** | |
* Slow method |
CREATE FUNCTION `convert_currency`(cur_from INT, cur_to INT, amount DOUBLE, rate_rub DOUBLE, rate_dollar DOUBLE, rate_euro DOUBLE) | |
RETURNS double DETERMINISTIC | |
BEGIN | |
DECLARE result DOUBLE DEFAULT amount; | |
DECLARE delta DOUBLE; | |
DECLARE TYPE_DOLLAR INT; | |
DECLARE TYPE_EURO INT; | |
DECLARE TYPE_RUBLES INT; |
function sum(n) { | |
var self = sum; | |
if (typeof n === 'undefined') { | |
var result = self.numbers.reduce(function (prev, next) { return prev + next; }, 0); | |
self.numbers = []; | |
return result; | |
} | |
if ( ! self.numbers ) { self.numbers = [] }; |
<?php | |
function prepareLink($link, $allowedDomains = []) { | |
$parsed = parse_url($link); | |
$withoutScheme = preg_replace("/[a-z]+:\/\/(.*)/", "$1", $link); | |
if (in_array($parsed['host'], $allowedDomains)) { | |
$href = preg_replace(sprintf("/.+%s(.*)/", $parsed['host']), "$1", $link); | |
return sprintf('<a href="%s">%s</a>', $href, $withoutScheme); | |
} |
var waitSeconds = function (seconds) { | |
if (waitSeconds.promise) { | |
return waitSeconds.promise; | |
} | |
var defer = $.Deferred(); | |
setTimeout(function () { | |
defer.resolve(); | |
}, 1000 * seconds); |
var $_GET = (function () { | |
var getParams; | |
return function (param) { | |
if ( ! getParams ) { | |
getParams = decodeURIComponent(window.location.search.slice(1)) | |
.split('&') | |
.reduce(function _reduce (a, b) { | |
b = b.split('='); | |
a[b[0]] = b[1]; |
function find() { | |
var bg = document.getElementById('kolor-kolor').style.backgroundColor; | |
var options = document.querySelectorAll('#kolor-options a'); | |
[].slice.call(options, 0).forEach(function (el) { | |
var clickEvent = new Event('click'), | |
dest = el; | |
if (el.style.backgroundColor == bg) { | |
el.style.border = "10px solid red"; | |
el.dispatchEvent(clickEvent); |
I hereby claim:
To claim this, I am signing this object: