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 splitIntoGroups(chunks, str) { | |
var splitAt = str.charAt(0) === '"' ? | |
// if the string starts with a quote at this point, | |
// find the next quote or the end of the string | |
str.indexOf('"', 1) > -1 ? str.indexOf('"', 1) : str.length : | |
// otherwise, break at the next space | |
str.indexOf(' ', 1) > -1 ? str.indexOf(' ', 1) : str.length, | |
word = str.substring(0, splitAt).replace('"', '').trim(); |
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 roll() { | |
return Math.ceil(Math.random() * 6); | |
} | |
function compare() { | |
var one = [roll(), roll(), roll()].sort(function (a, b) { return b-a }).slice(0,2); | |
var two = [roll(), roll()].sort(function (a, b) { return b-a }); | |
var score = 0; | |
one.forEach(function (item, index) { |
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 uphxlib | |
# upgrade normal haxe repositories | |
echo 'a' | haxelib upgrade | |
# keep track of the current directory | |
set current_dir (pwd) | |
# update all 'dev' repo git repositories | |
for lib in (haxelib list | cut -d: -f2- | grep 'dev:') | |
set dev_dir (echo $lib | rev | cut -c 2- | rev | cut -d '[' -f2- | cut -c5-) |
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
<section class="tan two-line"> | |
<a href="#" class="simple">Order your<br /> B.E.A.R.S. Today</a> | |
<a href="#" class="round">Order your<br /> B.E.A.R.S. Today</a> | |
<a href="#" class="square">Order your<br /> B.E.A.R.S. Today</a> | |
</section> | |
<section class="gold two-line"> | |
<a href="#" class="simple">Order your<br /> B.E.A.R.S. Today</a> | |
<a href="#" class="round">Order your<br /> B.E.A.R.S. Today</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
// get names and ratings for BFZ cards from ChannelFireball | |
function getRatings() { | |
var list = [].slice.apply($('.postContent h1').not(":first").not(":last")); | |
return list.map(function(el) { | |
var rating = $(el).next().next().clone().find("b").remove().end().text() | |
return { | |
name: el.textContent, | |
rating: parseFloat(rating) | |
}; | |
}); |
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
// Type definitions for Lovefield v2.0.62 | |
// Project: http://google.github.io/lovefield/ | |
// Definitions by: freshp86 <https://github.com/freshp86> | |
// Definitions: https://github.com/borisyankov/DefinitelyTyped | |
/// <reference path="../es6-promise/es6-promise.d.ts"/> | |
declare module lf { | |
export enum Order { ASC, DESC } |
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
// `gulp stylus --prod` will enable "production mode" | |
// `gulp stylus` will leave the prod flag undefined, so it will do a dev build | |
var gulp = require('gulp'), | |
gutil = require('gulp-util'), | |
prod = gulp.env.prod; | |
gulp.task('stylus', ['cleancss'], function () { | |
var stylus = require('gulp-stylus'), | |
prefix = require('gulp-autoprefixer'), | |
minify = require('gulp-minify-css'); |
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 sections = [{ | |
id: "A", | |
flag: false, | |
subsections: [{ | |
id: "A1", | |
subsections: [{ | |
id: "A1a", | |
flag: true | |
}, { | |
id: "A1b" |
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 flat = [ | |
{ id: "A", name: "A", parent: "" }, | |
{ id: "B", name: "B", parent: "" }, | |
{ id: "C", name: "C", parent: "D" }, | |
{ id: "D", name: "D", parent: "B" }, | |
{ id: "E", name: "E", parent: "A" } | |
]; | |
function unflatten(list) { | |
return; //... |
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
// I rewrite these way too often, so here they are: | |
// upgrades | |
Game.UpgradesById | |
.filter(function (up) { | |
return !up.bought && up.pool != "prestige" && up.pool != "toggle" && up.pool != "debug"; | |
}) | |
.map(_ => _.name); | |
// achievements |