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
# A trivial-case processor. This is a custom paperclip processor that doesn't do anything but generate thumbnails like it normally would. | |
# RAILS_ROOT/lib/paperclip_processors/general_processor.rb | |
module Paperclip | |
class General < Processor | |
def make | |
Thumbnail.make( @file, @options, @attachment ) | |
end | |
end # class |
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
class Clip < ActiveRecord::Base | |
belongs_to :clippable, :polymorphic => true | |
has_attached_file :document, | |
:styles => { :thumbnail => "50x50#", | |
:medium => "200x200", | |
:large => "450x450>", | |
:jumbo => "1024x1024>" | |
}, | |
:processors => [:general], |
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 'directory_watcher' | |
# gem 'directory_watcher.rb' | |
# gem 'rev' | |
#command = 'rspec --drb --color spec' | |
command = "cucumber --drb -f html -o tmp/cuke.html -f progress -o tmp/progress.txt features" | |
dw = DirectoryWatcher.new '.', :pre_load => true, :scanner => :rev | |
dw.glob = '**/*.{rb,feature,haml,erb}' |
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
# crontab -e | |
* * * * * /bin/bash -l -c 'cd /var/www/whatsyourfavoritewebsite.com/production ; script/rails server -p 3001 -e production -d' > /tmp/start_whatsyourfavoritewebsite 2>&1 |
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
bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function' >> ~/.bashrc | |
source .bashrc | |
rvm package install zlib | |
rvm package install openssl | |
rvm package install readline | |
rvm install 1.9.2 -C --with-zlib-dir=$rvm_path/usr --with-openssl-dir=$HOME/.rvm/usr --with-readline-dir=$rvm_path/usr | |
rvm install 1.9.2 | |
rvm --default 1.9.2 |
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
<!DOCTYPE html> | |
<html> | |
<body> | |
<canvas id="a" width="500" height="500"> | |
</canvas> | |
<div id='debug' style="background-color: #eee"></div> | |
<script> | |
var can = document.getElementById("a"); | |
var ctx = can.getContext("2d"); | |
var x0=100, |
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
# Put this in ~/.screenrc: | |
# This will remap CTRL-A (the normal screen command-mode toggle key combo) to CTRL-Z, | |
# because I like to preserve CTRL-A to go to the beginning of the command line. | |
defscrollback 5000 | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{=kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{B}%Y-%m-%d %{W}%c %{g}]' | |
# .screenrc | |
# EOF |
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
<script> | |
var H = function(){ | |
var g=function(){}; | |
g.prototype.children = []; | |
g.prototype.values = {}; | |
g.prototype.walk = function(f){ | |
for(var i in H.all){ |
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
sudo tcpdump -i en1 -s0 -A tcp port 80 | |
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
# Set your current branch to be the one your push and pull from remotely, so that you can just say "git pull" and "git push" without having to say "git pull origin mybranch" or "git push origin mybranch" | |
git branch --set-upstream | |
git push --set-upstream |
OlderNewer