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
require 'combine_pdf' | |
input = 'filename.pdf' | |
output = 'filename.pdf' | |
num = 10 | |
pdf = CombinePDF.new | |
CombinePDF.new(input).pages.each.with_index(1) do |page, i| | |
pdf << page unless i == num | |
end |
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
require 'dotenv' | |
Dotenv.load | |
require 'benchmark' | |
require 'multi_json' | |
require 'firebase' | |
require 'patron' | |
Benchmark.bmbm do |x| |
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
assert(typeof moment == 'function', 'moment dependency') | |
function gt (input, key) { | |
var dur = moment.duration(input, key) | |
return this.as('milliseconds') > dur.as('milliseconds') | |
} | |
function lt (input, key) { | |
var dur = moment.duration(input, key) | |
return this.as('milliseconds') < dur.as('milliseconds') |
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
.switch input { | |
display: none; | |
} | |
.switch i { | |
display: inline-block; | |
cursor: pointer; | |
padding-right: 20px; | |
transition: all ease 0.2s; | |
border-radius: 20px; |
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
system 'touch README.md' | |
system 'mkdir scripts stylesheets templates' | |
# git | |
# http://git-scm.com/ | |
# http://git-scm.com/docs/gitignore | |
file = <<___ | |
node_modules | |
bower_components |
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
#!/usr/bin/env ruby | |
require 'nokogiri' | |
require 'open-uri' | |
if ARGV.length > 1 | |
puts 'redis-commands [group]' | |
exit 1 | |
end |
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 install -g strip-ansi | |
heroku logs | strip-ansi | grep 'web.\d' | awk '{ if($7 == "ms") print $6, "\t\t", $3, $4 }' | sort -nr | head -n 10 |
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
#!/usr/bin/env ruby | |
# put in scripts folder, and make executable | |
# $ chmod +x scripts/mongo | |
require 'yaml' | |
HELP = ''' |
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
{ | |
"private": true, | |
"name": "helloworld", | |
"version": "0.0.0", | |
"dependencies": { | |
"requirejs": "~2.1.9" | |
} | |
} |
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 path = require('path') | |
var dirname = path.dirname(require.main.filename) | |
var root = dirname.split('/node_modules/')[0] | |
module.exports = root |