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
$ irb | |
irb(main):001:0> require 'active_support/all' | |
=> true | |
irb(main):002:0> class Integer | |
irb(main):003:1> def fact | |
irb(main):004:2> (1..self).reduce(:*) || 1 | |
irb(main):005:2> end | |
irb(main):006:1> end | |
=> nil | |
irb(main):007:0> 10.fact == 6.weeks |
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
From 579377d5e510a4c138904181b640480524c30bce Mon Sep 17 00:00:00 2001 | |
From: "M. Scott Ford" <[email protected]> | |
Date: Fri, 2 Jan 2015 10:34:16 -0500 | |
Subject: [PATCH] Exports sftp_reply_* functions | |
--- | |
include/libssh/sftp.h | 24 ++++++++++++------------ | |
1 file changed, 12 insertions(+), 12 deletions(-) | |
diff --git a/include/libssh/sftp.h b/include/libssh/sftp.h |
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
static void calculateLinearShadingValues(void *info, const float *in, float *out) { | |
const int components = 4; | |
ColorPair *colors = (ColorPair *) info; | |
int index; | |
for (index = 0; index < components; index++) { | |
out[index] = (1.0 - *in) * colors->start[index] + *in * colors->stop[index]; | |
} | |
} |
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
{ echo 'one' && echo 'two'; }; say 'yo' |
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
rspec `git diff --name-only flux -- spec | egrep '_spec.rb'` |
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
sunstreaker% perl -pi -e 's/ +$//' **/*.rb | |
sunstreaker% perl -pi -e 's/ +$//' **/*.json | |
sunstreaker% perl -pi -e 's/ +$//' **/*.js | |
sunstreaker% perl -pi -e 's/ +$//' **/*.coffee | |
sunstreaker% perl -pi -e 's/ +$//' **/*.erb | |
sunstreaker% perl -pi -e 's/ +$//' **/*.sass | |
sunstreaker% perl -pi -e 's/ +$//' **/*.css | |
sunstreaker% perl -pi -e 's/ +$//' **/*.haml | |
sunstreaker% perl -pi -e 's/ +$//' **/*.rabl | |
sunstreaker% perl -pi -e 's/ +$//' **/*.html |
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
# spec/support/poltergeist_screenshot_helper.rb | |
module PoltergeistScreenshotHelper | |
# FROM http://blog.jerodsanto.net/2012/12/capybara-and-poltergeist-snap/ | |
def snap!(options={}) | |
path = options.fetch :path, "~/.Trash" | |
file = options.fetch :file, "#{Time.now.to_i}.png" | |
full = options.fetch :full, true | |
path = File.expand_path path |
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
find -name "*.ogg" -exec ffmpeg -ab 192k -i {} -map_meta_data 0:0 {}.mp3 \; |
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
sudo apt-get update | |
sudo apt-get install puppet-common | |
sudo useradd -d /home/deploy -m deploy | |
sudo passwd deploy | |
sudo chsh -s /bin/bash deploy | |
sudo visudo # append `deploy ALL=(ALL) NOPASSWD:ALL` | |
# copy up rsa.pub | |
sudo mv id_rsa.pub /home/deploy/.ssh/authorized_keys | |
sudo chmod 600 /home/deploy/.ssh/authorized_keys |
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
$ node --version | |
v0.10.13 | |
$ npm --version | |
1.3.2 | |
$ lineman --version | |
0.11.4 | |
$ lineman new test-app |