Skip to content

Instantly share code, notes, and snippets.

View lemanchester's full-sized avatar

Lennon Manchester lemanchester

View GitHub Profile
#!/usr/bin/env bash
#
# Install:
# curl -L https://gist.githubusercontent.com/lemanchester/260341aedc56cec082fb/raw/d74c358f5d6bbb7f3202a9ead5b450e93c8d8011/install_imagemagick.sh | bash
#
echo "*****************************************"
echo " Installing ImageMagick on Amazon Linux AMI "
echo "*****************************************"
echo "*"
echo "*"
@lemanchester
lemanchester / install_ruby
Created April 27, 2015 00:33
Installing Ruby 2.1.5 on Ubuntu
apt-get -y update
apt-get -y install build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev
cd /tmp
wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.5.tar.gz
tar -xvzf ruby-2.1.5.tar.gz
cd ruby-2.1.5/
./configure --prefix=/usr/local
make
make install
@lemanchester
lemanchester / example
Created April 1, 2014 18:04
NVD3 - Cumulative Chart (getting wrong yScale)
<!DOCTYPE html>
<meta charset="utf-8">
<link href="../src/nv.d3.css" rel="stylesheet" type="text/css">
<style>
body {
overflow-y:scroll;
}
@lemanchester
lemanchester / wtf
Last active August 29, 2015 13:57
DateTime Ruby to Javascript - WTF?
Ruby:
DateTime.parse("2013-08-01 00:00:00").utc.to_i*1000
1375315200000
Javascript:
alert(d3.time.format('%m/%d/%Y')(new Date(1375315200000)))
Result
@lemanchester
lemanchester / benchmark-string-result
Created February 24, 2014 14:59
String Interpolation using Hash Vs. String Interpolation. Benchmark on ruby 1.9.3 to verify which one has a better performance.
user system total real
hash interpolation 0.300000 0.010000 0.310000 ( 0.301211)
string interpolation 0.090000 0.000000 0.090000 ( 0.098942)
user system total real
hash interpolation 0.290000 0.010000 0.300000 ( 0.301891)
string interpolation 0.140000 0.000000 0.140000 ( 0.135461)
user system total real
hash interpolation 0.310000 0.010000 0.320000 ( 0.318774)