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 'amazon/aws' | |
require 'amazon/aws/search' | |
include Amazon::AWS | |
include Amazon::AWS::Search | |
KEY_ID = "" | |
ASSOCIATES_ID = "" | |
def self.get_aws_ads(keywords) | |
is = ItemSearch.new( 'All', { 'Keywords' => keywords } ) |
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 "term/ansicolor" | |
require "tempfile" | |
class Array | |
def split(length=self.length/2) | |
sets = Array.new | |
self.each_slice(length){|s| sets << s} | |
sets | |
end |
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
alias xclip='pbcopy' | |
alias c='xclip' | |
alias cdc='pwd | c' | |
alias p='pbpaste' | |
alias cdp='cd `p`' | |
alias clr='clear' | |
------- | |
alias c='xclip -selection c' |
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
# .irbrc | |
require 'rubygems' | |
begin | |
# load wirble | |
require 'wirble' | |
# start wirble (with color) | |
Wirble.init | |
Wirble.colorize | |
rescue LoadError => err |
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
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/[\1]/' | |
} | |
export PS1='\[\033[0;32m\]\h\[\033[0;36m\] \w\[\033[0;33m\]$(parse_git_branch)\[\033[00m\]: ' |
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
# Something I have wanted to write for a while, | |
# takes text and converts to an image, very simple. | |
# Erick Schmitt - July 19, 2009 | |
module ImageText | |
require 'rubygems' | |
require 'fileutils' | |
require 'RMagick' | |
include Magick |
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
def obtain_class | |
class_name = ENV['CLASS'] || ENV['class'] | |
raise "Must specify CLASS" unless class_name | |
@klass = Object.const_get(class_name) | |
end | |
def obtain_attachments | |
name = ENV['ATTACHMENT'] || ENV['attachment'] | |
raise "Class #{@klass.name} has no attachments specified" unless @klass.respond_to?(:attachment_definitions) | |
if !name.blank? && @klass.attachment_definitions.keys.include?(name) |
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
var conditionalLoader = function (condition, execute) { | |
var interval = setInterval(function () { | |
if (condition()) { | |
clearInterval(interval); | |
execute(); | |
} | |
}, 50); | |
}; |
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
#!/bin/bash | |
############################################################################ | |
# Script to open a directory in TextMate excluding certain directories that | |
# tend to slow down the Find in Project... function. | |
# | |
# Place in an executable loctation with a name of your choosing. | |
# I use `mt' | |
# Original: http://www.wezm.net/technical/2009/05/exclude-directories-from-textmate-side-bar-for-faster-find-in-project/ | |
############################################################################ |
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
copy this file to ~/.git-completion.sh | |
https://github.com/git/git/blob/master/contrib/completion/git-completion.bash | |
Add this to your .bashrc, or .profile, or whatever: | |
source ~/.git-completion.sh |
OlderNewer