sudo apt-get install ruby-dev
sudo gem install pkg-config
sudo gem install nokogiri -- --use-system-libraries
sudo apt-get install zlib1g-dev
sudo gem install html-proofer
This file contains hidden or 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 = arr.reduce(function(done,curr){ | |
return done.concat(curr); | |
}, []); | |
// [ 1, 2, 3, [ [ 4 ] ] ] |
This file contains hidden or 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 flatten(arr) { | |
if (Array.isArray(arr)) { | |
return arr.reduce(function(done,curr){ | |
return done.concat(flatten(curr)); | |
}, []); | |
} else { | |
return arr; | |
} | |
} |
This file contains hidden or 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
// changes based on current time | |
var time = new Date().getMinutes(); | |
// sets the time to every ten minutes | |
var index = Math.floor(time/10); | |
var json = { | |
0:"Clever message zero.", | |
1:"Clever message one.", | |
2:"Clever message two.", | |
3:"Clever message three.", | |
4:"Clever message four.", |
This file contains hidden or 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 makeMeASandwich(x) { | |
var ingredients = x.join(' '); | |
var slices = 0; | |
function barry() { | |
return ingredients.concat(' sandwich'); | |
} | |
function barryAddCheese() { | |
slices += 2; | |
return ingredients.concat(' sandwich with ', slices, ' slices of cheese'); |
This file contains hidden or 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 makeMeASandwich(x) { | |
var ingredients = x.join(' '); | |
return function barry() { | |
return ingredients.concat(' sandwich'); | |
} | |
} |
This file contains hidden or 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
package main | |
import ( | |
"math/rand" | |
"net/url" | |
"os" | |
"time" | |
"github.com/ChimeraCoder/anaconda" | |
"github.com/Sirupsen/logrus" |
This file contains hidden or 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/sh | |
# in git repo: cp pre-commit-imgopt .git/hooks | |
# add execute permissions: chmod +x .git/hooks/pre-commit-imgopt | |
find . -name '*.png' -print0 | xargs -0 -P8 -n2 optipng -o5 | |
find . -name '*.jpg' -print0 | xargs -0 -P8 -n2 jpegoptim --strip-all -m30 |
This file contains hidden or 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
SHELL:=/bin/bash | |
BASEDIR=$(CURDIR) | |
OUTPUTDIR=$(BASEDIR)/public | |
optipng = find $(OUTPUTDIR) -name '*.png' -print0 | xargs -0 -P8 -n2 optipng -o5 -strip all -quiet | |
optijpg = find $(OUTPUTDIR) -name '*.jpg' -print0 | xargs -0 -P8 -n2 jpegoptim --strip-all -m30 -q | |
site: | |
@echo "Deleting files from old publication" |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"math" | |
) | |
// Slice a `x` inch diameter pie into `n` pieces. | |
// Return true if each slice is greater than `m` inches wide. |
OlderNewer