Skip to content

Instantly share code, notes, and snippets.

View SorenPeterson's full-sized avatar

Soren Peterson SorenPeterson

View GitHub Profile
@SorenPeterson
SorenPeterson / hbcompile.rb
Created March 27, 2015 18:27
A small ruby script to precompile handlebars file. Note: files must be named with extension .hbs
files = `ls`
files = files.split("\n")
files = files.select do |filename|
filename =~ /\A\w+.hbs\z/
end
files.each do |filename|
new_filename = filename.gsub(/\A(\w+).hbs\z/, '\1.tpl.js')
`handlebars #{filename} -f #{new_filename}`
end

Keybase proof

I hereby claim:

  • I am sorenpeterson on github.
  • I am soren468 (https://keybase.io/soren468) on keybase.
  • I have a public key ASDD-gAAE2ieW3ST1g3faj_sQ4P5kbTYdIbh-S_jfhqBEwo

To claim this, I am signing this object:

# Generates the text of asetniop.vim
singles =
a: "a"
s: "s"
e: "d"
t: "f"
n: "j"
i: "k"
o: "l"
p: ";"
@SorenPeterson
SorenPeterson / Sizes.md
Last active August 29, 2015 14:24 — forked from jperl/Sizes.md

###Icons

Name Size
iphone_2x 120x120
iphone_3x 180x180
ipad 76x76
ipad_2x 152x152
android_ldpi 36x36
android_mdpi 48x48
contract Company {
address public ceo;
mapping (address => Employee)
struct Employee
{
uint dailySalary;
}
function Company()
cd sorenpeterson.me
git pull origin master
cd app
meteor build .
mv app.tar.gz /home/sorenpeterson/
cd /home/sorenpeterson/
tar -zxf app.tar.gz
cd bundle/programs/server
npm install
restart sorenpeterson
@SorenPeterson
SorenPeterson / notnot.js
Last active August 25, 2016 16:02
An explanation of why double negation is valuable.
var obj = {};
if (obj) {
// this would run because obj is truthy. See https://developer.mozilla.org/en-US/docs/Glossary/Truthy and https://developer.mozilla.org/en-US/docs/Glossary/Falsy
}
if (!!obj) {
// this would also run because obj is truthy.
// when you negate it the first time, it becomes the value false
// when you negate it the second time, it turn that false value into true