Skip to content

Instantly share code, notes, and snippets.

View jeffrydegrande's full-sized avatar

Jeffry Degrande jeffrydegrande

View GitHub Profile
(function() {
Thing = {};
Thing.findAll = function(callback) {
$.getJSON('/things', function(data) {
if (data!=null) {
callback(data);
}
});
}
@jeffrydegrande
jeffrydegrande / setup-statsd.sh
Created April 1, 2012 01:54 — forked from collegeman/setup-statsd.sh
Turn an Ubuntu 10.04 linode into a StatsD/Graphite server
# 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
#!/bin/bash
set -e
VERSION="1.9.2-p290"
# build dependencies
sudo apt-get install libssl-dev
sudo gem install fpm
#!/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
› 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
(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)
@jeffrydegrande
jeffrydegrande / gist:1565665
Created January 5, 2012 15:14
fix data in mysql that has been encoded to utf8 twice
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
class Something
end
describe Something do
pending "not yet implemented" do
describe 'something' do
end
end
#!/bin/bash
set -e
VERSION="1.9.2-p180"
# build dependencies
sudo apt-get install libssl-dev
sudo gem install fpm
<embed src="http://www.youtube.com/v/XFG7gpB4zz0&autoplay=1&loop=1" type="application/x-shockwave-flash" allowfullscreen="false" width="1" height="1"></embed>