Skip to content

Instantly share code, notes, and snippets.

View dideler's full-sized avatar

Dennis Ideler dideler

View GitHub Profile
unless ARGV.size == 2
puts "USAGE: ruby draw_something.rb ACKRCKOOLCWZ 5"
exit 1
end
letters = ARGV[0].downcase.split(//).sort
length = ARGV[1].to_i
require 'open-uri'
uri = 'http://static.iminlikewithyou.com/drawsomething/wordlist.csv'
@dideler
dideler / twitter-gadget-instructions.md
Last active August 29, 2016 03:08
Twitter Gadget for Google Sites

How to display a Twitter feed on your Google Site

A short tutorial for creating a Twitter gadget for Google Sites that will display tweets from a user or search.

Problem

Displaying Twitter tweets on your Google Sites website is difficult!
Google Sites filters your HTML code and doesn't allow you to add your own JavaScript code, therefore restricting you from adding any of the many existing Twitter widgets that exist today, including Twitter's very own.

The Google Gadgets directory contains a Twitter gadget called Twit. This is the gadget I was using in the past.

@them0nk
them0nk / rspec_rails_cheetsheet.rb
Created March 23, 2012 03:39
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)
@arirusso
arirusso / video-example.rb
Created March 27, 2012 23:54
ruby-processing: video processing example
#!/usr/bin/env ruby
# this is a test of ruby-processing (https://github.com/jashkenas/ruby-processing) with the video library
# use "rp5 unpack library" at a command line to install the video library, among others
# tested with Ruby 1.9.2
# video file: http://bit.ly/H5yBjK
class VideoTest < Processing::App
@arirusso
arirusso / video-capture-example.rb
Created March 28, 2012 00:36
ruby-processing: video capture processing example
#!/usr/bin/env ruby
# this is a test of ruby-processing (https://github.com/jashkenas/ruby-processing) with video capture
# use "rp5 unpack library" at a command line to install the video library, among others
# tested with Ruby 1.9.2 on OSX with built in web cam
class VideoCaptureTest < Processing::App
@arirusso
arirusso / saturation1.rb
Created March 28, 2012 00:42
ruby-processing: video capture w/ saturation filter
#!/usr/bin/env ruby
# only show pixels that pass a certain threshold of color saturation
class SaturationFilter < Processing::App
load_library :video
include_package "processing.video"
def setup
@arirusso
arirusso / capture-to-file.rb
Created March 28, 2012 04:20
ruby-processing: video capture to a file
#!/usr/bin/env ruby
# this is a test of ruby-processing (https://github.com/jashkenas/ruby-processing) where
# captured video is written to a QuickTime file
# use "rp5 unpack library" at a command line to install the video library if you haven't
# tested with Ruby 1.9.2 on OSX with built in web cam
class VideoCaptureToFileTest < Processing::App
@btoone
btoone / curl.md
Last active April 2, 2024 20:18
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@zolrath
zolrath / gist:2305333
Created April 4, 2012 20:27
tmux status line from wemux example.

For a tmux status line as seen in the example image for the wemux project: wemux

The session on the left in the example screen shot uses a patched font from the vim-powerline project. Inconsolata-dz, you beautiful creature.

To duplicate the left status line add the following lines to your ~/tmux.conf

set -g status-left-length 32
set -g status-right-length 150
@dieterplex
dieterplex / request_time.py
Created April 26, 2012 07:19 — forked from andrewwatts/request_time.py
urllib2 vs urllib3 vs requests
#!/usr/bin/env python2.7
import urllib2
import time
_ITERATIONS = 200
start_time = time.time()
for i in range(0, _ITERATIONS):