Skip to content

Instantly share code, notes, and snippets.

View alexdean's full-sized avatar
🍩

Alex Dean alexdean

🍩
View GitHub Profile
@alexdean
alexdean / file.rb
Last active January 2, 2016 17:29
resizing an image with rmagick
require 'RMagick'
# http://www.imagemagick.org/RMagick/doc/comtasks.html#thumb
original_filename = 'image.jpg'
thumb_filename = 'thumb.jpg'
orig = Magick::Image.read(original_filename).first
rows, cols = [150, 150]
@alexdean
alexdean / 01_what_to_do.md
Last active December 26, 2015 04:39
how to use access the Todoist api using ruby & httparty.
  1. Run gem install httparty. This installs the HTTParty gem which the script uses. (A gem is a package containing ruby code which you can use. Hundreds of thousands of gems are available at https://rubygems.org.)
  2. Download the raw version of the ruby script and save it to a file locally. (Look for the 'View Raw' link in the upper-right corner.)
  3. Add your own email & password to the script.
  4. Run it and see how it goes.
  5. Look for ways you can expand this example at http://todoist.com/API/.
@alexdean
alexdean / _.md
Created September 20, 2013 18:23
reddit base
@alexdean
alexdean / _.md
Created September 20, 2013 18:22
cat clicking
@alexdean
alexdean / _.md
Last active December 23, 2015 13:19
reddit brush
@alexdean
alexdean / gist:6600466
Created September 17, 2013 20:52
wifi info on OSX 10.8
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -I
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport -s
video_id, language_code, title, translator_credit, reviewer_credit
_WLlHpCjrmE en Curing Cancer with Golden Nanoparticles: Dr. Amal Ayoub at TEDxJerusalem missing missing
0YzvupOX8Is es Una forma inteligente de estimar números enormes - Michael Mitchell present missing
9FCsyK4aRXQ en Modern Warrior: Damien Mander at TEDxSydney missing missing
AmFMJC45f1Q ar كيف يمكننا بطي الورق أن نصل الى القمر ؟ missing missing
b_lT6mJM_fA it Biocarburanti e bioprospezione per principianti - Craig A. Kohn missing missing
BMcduh1HEHA en Alzheimer and memory palaces: Kasper Bormans at TEDxLeuven missing missing
DD_8Jm5pTLk zh-tw 四季變化的原因 - Rebecca Kaplan missing missing
dlW0fa-FkPQ en The Happiness Advantage: Leda Karabela at TEDxThessaloniki missing missing
@alexdean
alexdean / ut.rb
Created April 8, 2013 16:42
convert time string to unix timestamp
#!/usr/bin/env ruby
require 'time'
t = Time.parse(ARGV[0])
puts "#{t.iso8601} -> #{t.to_i}"
@alexdean
alexdean / 1_output.txt
Last active December 15, 2015 22:59
fisica + ruby-processing bubble test demo
$ java -version
java version "1.6.0_43"
Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-11M4203)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode)
$ rp5 run bubbles.rb
RUBY_VERSION: 1.9.3
RUBY_PLATFORM: java
JRUBY_VERSION: 1.7.3
JRUBY_REVISION: dac429b
@alexdean
alexdean / output.txt
Last active December 15, 2015 22:39
ruby-processing regression between jruby 1.7.2 and 1.7.3?
$ rvm use system
$ rp5 run test_sketch.rb
RUBY_VERSION: 1.9.3
RUBY_PLATFORM: java
JRUBY_VERSION: 1.7.3
JRUBY_REVISION: dac429b
FDrawable stroke methods ==========
[]