This file contains 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 style = document.createElement('style') | |
var iframe = document.createElement('iframe') | |
document.body.appendChild(iframe) | |
iframe.contentDocument.documentElement.appendChild(style) | |
iframe.style.display = 'none' | |
style.textContent = 'a {color: red}' | |
style.sheet // CSSStyleSheet | |
style.sheet.cssRules[0].cssText // 'a { color: red; }' | |
style.sheet.cssRules[0].selectorText // 'a' |
This file contains 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
google.ac | |
google.ae | |
google.af | |
google.ag | |
google.am | |
google.com.ar | |
google.as | |
google.at | |
google.com.au | |
google.az |
This file contains 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 ligatweet | |
// @namespace http://leaverou.me/demos/ligatweet/ | |
// @description Script for tweet shortening using unicode ligatures and other compound symbols | |
// @include htt*://twitter.com/* | |
// @author Lea Verou (UserJS by Nikita Vasilyev) | |
// @version 1.0 | |
// @license Licensed under the MIT license http://www.opensource.org/licenses/mit-license.php | |
// ==/UserScript== |
This file contains 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
/** | |
* @jsx React.DOM | |
*/ | |
function c2f(c) { | |
return 9 / 5 * parseFloat(c) + 32; | |
} | |
function f2c(f) { | |
return 5 / 9 * (f - 32); | |
} |
This file contains 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 DeepLinkState = { | |
linkState: function(path) { | |
function setPath(obj, path, value) { | |
var leaf = resolvePath(obj, path); | |
leaf.obj[leaf.name] = value; | |
} | |
function getPath(obj, path) { | |
var leaf = resolvePath(obj, path); | |
return leaf.obj[leaf.name]; |
This file contains 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
callWithNamed({one: 1, two: 2, three: 3}, function(three, one, two) { | |
console.log(one, two, three); | |
}); | |
function callWithNamed(dict, fn, context) { | |
var newArgs = []; | |
var parsedArgs = parseArgs(fn); | |
for (var i = 0; i < parsedArgs.length; i++) { | |
var name = parsedArgs[i]; |
This file contains 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
attachPair(document.getElementById('a'), document.getElementById('b'), createPolygon()); | |
attachPair(document.getElementById('c'), document.getElementById('d'), createPolygon()); | |
attachPair(document.getElementById('e'), document.getElementById('f'), createPolygon()); | |
function attachPair(a, b) { | |
var polygon = createPolygon(); | |
draggable(a, { | |
onMove: function(e) { | |
update(a, b, polygon); | |
} |
Serve static files in a current directory and create $current_dir.dev
host name.
~/Sites/usercss.ru ➤ pow
open http://usercss.ru.dev/
~/Sites/n12v.com/static ➤ pow n12v