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
interface Cat { | |
id: number | |
typ: "cat" | |
data: {purrs: boolean} | |
} | |
interface Dog { | |
id: number | |
typ: "dog" |
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
<script src="http://bgpatterns.com/widget.js" data-bgpatterns></script> | |
<script> | |
BGPatterns | |
.on('update', function(url) { document.body.style.backgroundImage = 'url(' + url + ')'; }) | |
.on('open', function() { console.log('Open' );}) | |
.on('close', function() { console.log('Closed' );}) | |
.open(); | |
</script> |
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
// ---- | |
// libsass (v3.2.5) | |
// ---- | |
// --- a3-fe --- | |
// uncomment one of these 2, both sjhould work | |
$utk-color: #444; | |
//$oldVarName: #555; |
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
'use strict'; | |
/** | |
* // parser middleware | |
* // parse `git blame --line-porcelain` output | |
* app.use(function(req, res, done) { | |
* req | |
* .pipe(new Parser()) | |
* .pipe(new Result(function(blamed) { | |
* req.blamed = blamed; |
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
<frameset cols="50%,50%"> | |
<frame src="1.html" /> | |
<frame src="2.html" /> | |
</frameset> |
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 onload = function() { | |
api_ready = true; | |
window.CD.conf(conf); | |
callback(); | |
}; | |
script.onload = onload; | |
script.onreadystatechange = function() { | |
if ('loaded' === script.readyState) { |
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
import tornadoredis | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.web | |
import tornado.gen | |
class Handler(tornado.web.RequestHandler): | |
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
/** Emulate "submit" and "change" events bubbling | |
* | |
* This plugin enables handling bubbling submit/change events by browsers which | |
* natively don't support this. It only augments `Element.on()` method and doesn't | |
* fix when this events are observed with `observe()`. | |
*/ | |
;(function() { | |
// Technique from Juriy Zaytsev | |
// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/ | |
function isEventSupported(eventName) { |
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
<?php | |
abstract class ParentClass { | |
private static $instances = array(); | |
function getInstance($obj) { | |
$class = get_called_class(); | |
if (!array_key_exists($class, self::$instances)) { |