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
document.querySelector("head") | |
.appendChild(document.createElement("style")) | |
.innerText = | |
"* {" + | |
["transition-property: all !important","transition-duration: 2s !important"] | |
.map(function (s) { | |
return ["-webkit-","-moz-","-ms-","-o-", ""] | |
.map(function (p) { return p + s; }); | |
}) | |
.reduce(function (flat, arr) { |
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
(function ($) { | |
var keys = { | |
ARR_RIGHT: 39, | |
ARR_LEFT: 37, | |
SPACE: 32 | |
}; | |
var btnNext = $("input#next"); | |
var btnPrev = $("input#prev"); | |
function kbdCntrl(e) { |
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
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Shakespearean insult generator</title> | |
<style> | |
* { | |
box-sizing: border-box; | |
font-family: "Comic Sans MS", "Comic Sans"; | |
} | |
body { |
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
#!/bin/bash | |
CWD=$(pwd) | |
ROOT="$CWD/drupal-$(date +%F-%H%M%S)" | |
DRUPAL="http://ftp.drupal.org/files/projects/drupal-7.17.tar.gz" | |
MODULES="entity restws devel :devel_generate ctools services :xmlrpc_server" | |
CMDS="drush curl patch" | |
LOG="$CWD/install.log" | |
exec 2>$LOG |
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
<!doctype html> | |
<html> | |
<head> | |
<title>Canvas with partial redraw</title> | |
</head> | |
<body> | |
<script type="text/javascript"> | |
function prop(pname) { | |
return function (o) { |
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 Foo = (function (Parent) { | |
var _super = Parent.prototype; | |
function Foo() { | |
Parent.call(this); | |
} | |
Foo.prototype = new Parent; | |
Foo.prototype.constructor = Foo; | |
Foo.prototype.ping = function () { |
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
#!bash | |
# Usage: | |
# | |
# In your .bashrc | |
# | |
# export PROJECTS_HOME=<path_to_projects_root> | |
# source jump-to-project.bash | |
# | |
# In you shell: |
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
(function (root, factory) { | |
var name = "FooMod"; | |
var deps = ["this", "that", "whatnot"]; | |
if (typeof exports === "object") { | |
module.exports = factory.apply(undefined, deps.map(function (d) { return require(d); })); | |
} else if (typeof define === "function" && define.amd) { | |
define(deps, factory); | |
} else { | |
root[name] = factory.apply(undefined, map(deps, function (d) { return root[d]; })); |
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
#!/bin/bash | |
PIDFILE="/tmp/runserver.pid" | |
CWD=$(pwd) | |
RUNENV=$1 | |
SERVER_PID="" | |
CRASH_RECOVERIES=0 | |
CRASH_RECOVERIES_MAX=3 | |
start_server() { |
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 the required modules | |
var fs = require("fs"); | |
var parseUrl = require("url").parse; | |
var http = require("http"); | |
var express = require("express"); | |
var handlebars = require("handlebars"); | |
var Q = require("q"); | |
var FB = require('fb'); | |
// Read the template file from disk |