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/python | |
import random | |
# ------------------------------------------------------------------------------ | |
# Constants | |
# ------------------------------------------------------------------------------ | |
# Moves | |
_ = 0 | |
X = 1 |
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
/*! | |
* (c) 2015 Beau Sorensen | |
* MIT Licensed | |
* For all details and documentation: | |
* https://github.com/sorensen/tendon.js | |
*/ | |
// TODO: Verify on-change detection for all HTML element types | |
;(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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE> | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
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'; | |
/*! | |
* Module dependencies. | |
*/ | |
var config = {} | |
, cache = {} | |
, timeouts = {} | |
, limit = config.size_limit |
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
/** | |
* Object flattener | |
* http://stackoverflow.com/questions/19098797/fastest-way-to-flatten-un-flatten-nested-json-objects | |
* | |
* @param {Object} obj to flatten | |
* @return {Object} flattened obj | |
*/ | |
function flatten(data) { | |
var result = {} |
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
APPLE= | |
BANANA= | |
CARROT= | |
DINOSAUR=false | |
ELEPHANT=false | |
while true; do | |
case "$1" in | |
-a | --apple ) APPLE=$2; shift 2 ;; | |
-b | --banana ) BANANA=$2; shift 2 ;; |
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 argv = process.argv | |
, slice = Array.prototype.slice | |
function getArg() { | |
var args = slice.call(arguments) | |
for (var i = 0; i < args.length; i++) { | |
var name = args[i] | |
, idx = argv.indexOf(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
/** | |
* Get first defined argument | |
* | |
* @param {...} any argument(s) | |
* @return {Any} first defined argument | |
*/ | |
exports.defined = function() { | |
var args = Array.prototype.slice.call(arguments); |
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 val = someUserInput | |
// Check to see if a valid timestamp was used | |
if (!isNaN(+val)) { | |
if (val.length === 13 || val.length === 10) { | |
return new Date(val.length === 10 ? +val * 1000 : +val); | |
} | |
} | |
// Check if the string could be parsed by the date formatter |
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
;['View' | |
, 'Model' | |
, 'Collection' | |
, 'Router' | |
].forEach(function(klass) { | |
var original = Backbone[klass] | |
Backbone[klass] = original.extend({ | |
constructor: function() { | |
// Custom logic here... | |
return original.apply(this, arguments); |
NewerOlder