This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function uuidv4() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function jsonp(u,d,cb){ | |
var rndKey = 'c' + Math.round(Date.now()) + '_' + jsonp.length; | |
jsonp.cb[rndKey] = function(data) { | |
cb(data); | |
} | |
d.callback = 'jsonp.cb.' + rndKey; | |
var p = []; | |
for (var e in d) { | |
if (d.hasOwnProperty(e)) { | |
p.push(encodeURIComponent(e) + '=' + encodeURIComponent(d[e])); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Twitter UserID | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description show Twitter User-IDs | |
// @author You | |
// @match https://twitter.com/* | |
// @grant none | |
// ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Mustache(template, placeholders) { | |
function isDef(x) { return typeof placeholders[key] === 'undefined'; } | |
var __tmpElement = document.createElement('span'); | |
function htmlencode(x) { __tmpElement.innerText = x; return __tmpElement.innerHTML; } | |
function getValue(key) { | |
var obj = placeholders, keys; | |
try { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var autoset = null; | |
var isMoved = false; | |
$(document).on('mouseup', function() { | |
autoset = null; | |
isMoved = false; | |
}); | |
$('#campaign-list').on('mousedown', 'input[type=checkbox]', function(e) { | |
autoset = !$(this).prop('checked'); | |
$(this).prop('checked', autoset); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// $Id: URL.php,v 1.6.1 2003/07/15 23:38:15 k1m Exp $ | |
// +----------------------------------------------------------------------+ | |
// | URL Class 0.3.3 | | |
// +----------------------------------------------------------------------+ | |
// | Author: Keyvan Minoukadeh - [email protected] - http://www.keyvan.net | | |
// | Contributor: Dominik Deobald - [email protected] | | |
// +----------------------------------------------------------------------+ | |
// | PHP class for handling URLs | | |
// +----------------------------------------------------------------------+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function TO_DAYS($date) { | |
if (is_numeric($date)) { | |
$res = 719528 + (int) ($date / 86400); | |
} else { | |
$TZ = date_default_timezone_get(); | |
date_default_timezone_set('UTC'); | |
$res = 719528 + (int) (strtotime($date) / 86400); | |
date_default_timezone_set($TZ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function ob_end_flush_minified() { | |
$content = ob_get_contents(); | |
ob_end_clean(); | |
$content = minify_html($content); | |
echo $content; | |
} |