This file contains 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
Love this. | |
How do I tell it that I want this to be ruby? |
This file contains 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
-# File: application.html.haml | |
-# Include YUI in your head | |
=yui_loader_includes | |
-# File: _tab_view.html.haml | |
-# To use a component in one of your views, call yui_require | |
-# Components are loaded using the yui loader, dependencies are managed | |
-# Any code added to yui_script filter will be rolled into single init function and outputted with the loader | |
This file contains 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
# File: ec2_bundle.rb | |
# Author: Luke Hubbard | |
# Gist: http://gist.github.com/gists/8770 | |
# License: MIT | |
# Desc: Simple script to bundle and upload an EC2 instance | |
require 'open-uri' | |
# Helpers | |
def read(file) |
This file contains 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
# File: robot.rb | |
# Author: Luke Hubbard | |
# Gist: http://gist.github.com/gists/18289 | |
# License: MIT | |
# Description: Ruby version of robot to solve Google Treasure Hunt. | |
def robot(rows, cols) | |
matrix = Array.new(rows).collect{ Array.new(cols) } | |
x, y = rows-1, cols-1 | |
x.downto(0) do |row| |
This file contains 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
# File: c_version_robot.rb | |
# Author: Luke Hubbard | |
# Gist: http://gist.github.com/gists/18325 | |
# License: MIT | |
# Description: C version of the robot for Google Treasure Hunt. | |
# Bugs: Cant handle big grids, numbers too big. | |
require 'rubygems' | |
require 'inline' | |
This file contains 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
# File: swf.rb | |
# Author: Luke Hubbard | |
# Gist: http://gist.github.com/20755 | |
# License: MIT | |
# NOTE THIS HAS NOW BEEN REPLACE BY | |
# http://github.com/code/swf_object_helper | |
# SWFObject Embed Helper - Easy swf embed using SWFObject and ruby magic | |
# |
This file contains 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
# File: password_generator.rb | |
# Author: Luke Hubbard | |
# Gist: http://gist.github.com/21812 | |
# License: MIT | |
require 'digest' | |
class PasswordGenerator | |
CHARS = (('a'..'z').to_a + ('0'..'9').to_a) - %w(i o 0 1 l 0) | |
SIZE = 9 |
This file contains 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
export TZ="Europe/London" | |
export LD_LIBRARY_PATH="$HOME/.packages/lib" | |
export PATH="$HOME/.packages/bin:$HOME/.gems/bin:${PATH}" | |
export GEM_HOME="$HOME/.gems" | |
export GEM_PATH="$GEM_HOME:/usr/lib/ruby/gems/1.8" |
This file contains 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
EDITOR="/usr/bin/nano -w" | |
export PS1="\\[\\e]0;\\w\\a\\]\\n\\[\\e[32m\\]\\u@\\h \\[\\e[33m\\]\\w\\[\\e[0m\\]\\n\\\$ " | |
export LS_COLORS="no=00:fi=00:di=01;36:ln=01;35:pi=40;33:so=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:" | |
export LSCOLORS='GxFxcxdxCxegedabagacad' | |
# GENERAL | |
alias df='df -h' | |
alias du='du -h' | |
alias grep='grep --color' |
This file contains 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
require 'rubygems' | |
require 'open-uri' | |
require 'json' | |
# Twitter search in one line, got to love ruby. | |
def twitter_search(q); JSON.parse(open("http://search.twitter.com/search.json?q=#{q}").read) end | |
# puts twitter_search("codegent").inspect |
OlderNewer