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
# So .. if I really need to have different behavior | |
# based on gender ... | |
class Male < Person | |
end | |
class Female < Person | |
end | |
FactoryGirl.define do |
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
using System; | |
using System.Collections.Generic; | |
using Newtonsoft.Json; | |
using Newtonsoft.Json.Converters; | |
public class Event | |
{ | |
private DateTime date; | |
[JsonProperty("name")] | |
public string Name { get; set; } |
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() { | |
Thing = {}; | |
Thing.findAll = function(callback) { | |
$.getJSON('/things', function(data) { | |
if (data!=null) { | |
callback(data); | |
} | |
}); | |
} |
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
# install git | |
sudo apt-get install g++ curl libssl-dev apache2-utils | |
sudo apt-get install git-core | |
# download the Node source, compile and install it | |
git clone https://github.com/joyent/node.git | |
cd node | |
./configure | |
make | |
sudo make install | |
# install the Node package manager for later use |
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/bash | |
set -e | |
VERSION="1.9.2-p290" | |
# build dependencies | |
sudo apt-get install libssl-dev | |
sudo gem install fpm |
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/bash | |
set -xe | |
if [ -f /var/lib/jenkins/.bash_profile ]; then | |
source /var/lib/jenkins/.bash_profile | |
fi | |
ruby -v | |
export LC_ALL=en_US.UTF-8 | |
export DISPLAY=:99 |
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
› bundle exec rspec spec | |
/Users/jeffry/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/ttfunk-1.0.1/lib/ttfunk/encoding/mac_roman.rb:4: [BUG] Bus Error | |
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.1.0] | |
-- control frame ---------- | |
c:0088 p:---- s:0286 b:0286 l:000870 d:000870 CFUNC :next | |
c:0087 p:---- s:0284 b:0284 l:000279 d:000283 IFUNC | |
c:0086 p:---- s:0282 b:0282 l:000281 d:000281 CFUNC :each | |
c:0085 p:---- s:0280 b:0280 l:000279 d:000279 CFUNC :zip | |
c:0084 p:0023 s:0276 b:0275 l:000274 d:000274 CLASS /Users/jeffry/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/ttfunk-1.0.1/lib/ttfunk/encoding/mac_roman.rb: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
(defn maybe-double-value [n, max] | |
(let [double (* 2 n)] | |
(cond (< double max) double | |
:else n ))) | |
(defn maybe-double-the-values [values max] | |
(map #(maybe-double-value %1 max) values)) | |
=> (maybe-double-the-values [1 2 3 4 5] 10) |
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
mysqldump -p --opt --quote-names --skip-set-charset --default-character-set=LATIN1 DATABASE > sql.dump | |
cat sql.dump | mysql -p --default-character-set=utf8 DATABASE |
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
class Something | |
end | |
describe Something do | |
pending "not yet implemented" do | |
describe 'something' do | |
end | |
end |