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>a quick example</title> | |
<style type="text/css"> | |
button { | |
font-size: 22pt; | |
width: 100px; | |
height: 100px; |
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
/* | |
* Return an array with the power set of a given string. | |
* Definition of power set: The set of all possible subsets including the empty set. | |
* | |
* Example: | |
* | |
* powerSet("abc") | |
* -> [ '' , 'a', 'b', 'c', 'ab', 'ac', 'bc', 'abc' ] | |
* | |
* Note: |
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 asyncMap = function(tasks, callback){ | |
var results = []; | |
var tasksCompleted = 0; | |
var makeCallBack = function(i) { | |
return function(x) { | |
results[i] = x; | |
tasksCompleted++; | |
if (tasksCompleted === tasks.length) { |
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 towerSolver = function(blocks) { | |
var result = 0; | |
var wallHeight = 0; | |
var underWater = []; | |
for (var i = 0; i < blocks.length; i++) { | |
if (blocks[i] >= wallHeight || i === blocks.length - 1) { | |
var smallestWall = Math.min(blocks[i], wallHeight); | |
wallHeight = blocks[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
;;in example.migration | |
(defn clean-db [& [force?]] | |
(if-not force? | |
(throw (Throwable. | |
"This is a destructive action! Pass in `force' to make this go through")) | |
(let [datasource (get-db-datasource) | |
flyway (doto (Flyway.) | |
(.setDataSource datasource) | |
(.setSqlMigrationPrefix ""))] | |
(.clean flyway)))) |
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
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror git://github.com/hackreactor-labs/utils.gulp-cardboard.git /Users/cschep/.npm/_git-remotes/git-github-com-hackreactor-labs-utils-gulp-cardboard-git-03eb0a90 | |
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror git://github.com/hackreactor-labs/utils.pagination.git /Users/cschep/.npm/_git-remotes/git-github-com-hackreactor-labs-utils-pagination-git-9573d19e | |
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror git://github.com/hackreactor-labs/utils.forkchop.git /Users/cschep/.npm/_git-remotes/git-github-com-hackreactor-labs-utils-forkchop-git-abb2d4c8 | |
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror git://github.com/hackreactor-labs/utils.gulp-problemify.git /Users/cschep/.npm/_git-remotes/git-github-com-hackreactor-labs-utils-gulp-problemify-git-2bf64c5c | |
npm ERR! git clone --template=/Users/cschep/.npm/_git-remotes/_templates --mirror ssh: |
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
" this isn't vi and apparently needs to be first? | |
set nocompatible | |
" pathogen | |
call pathogen#infect() | |
" shift O delay after insert mode? fuuuuu | |
set timeout timeoutlen=3000 ttimeoutlen=100 | |
" copypaste |
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 | |
set -e | |
if [ ! -f $2 ]; then | |
touch $2 | |
fi | |
echo $1 >> $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
// Load Albums into assetGroups | |
dispatch_async(dispatch_get_main_queue(), ^ | |
{ | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
// Group enumerator Block | |
void (^assetGroupEnumerator)(struct ALAssetsGroup *, BOOL *) = ^(ALAssetsGroup *group, BOOL *stop) | |
{ | |
if (group == nil) | |
{ |
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
// Enumerate Albums | |
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; | |
[library enumerateGroupsWithTypes:ALAssetsGroupAll | |
usingBlock:assetGroupEnumerator | |
failureBlock:assetGroupEnumberatorFailure]; | |
[library release]; |
OlderNewer