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
#!/usr/bin/env ruby | |
puts "Quack, quack!" |
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
One other cause is your :dependent callbacks. | |
class Blog < AR::Base | |
has_many :posts, :dependent => :destroy | |
end | |
This will iterate through every post and call #destroy on it. Use :delete_all if you want to just issue a single delete query. HOWEVER, this won't hit your destroy callbacks on Post. | |
class Blog < AR::Base | |
has_many :posts |
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
$ stkr start -fv test master ‹ruby-1.9.3› | |
Initializing the environment. | |
Cloning repositories | |
Cloning into /Users/grimen/StackRocket/apps/test... | |
Verifying VM | |
Importing VM: 99% | |
Fowarding ssh port 22 -> 2000 | |
Fowarding web port 80 -> 8000 | |
Starting VM |
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
module CarrierWave | |
module Smusher | |
module ClassMethods | |
def mush( ) | |
process :mush | |
end | |
end | |
def mush( ) | |
manipulate! do |img| |
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
(function() { | |
var v = "1.7.1"; | |
if (window.jQuery === undefined || window.jQuery.fn.jquery < v) { | |
var done = false; | |
var script = document.createElement("script"); | |
script.src = "http://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js"; | |
script.onload = script.onreadystatechange = function(){ | |
if (!done && (!this.readyState || this.readyState == "loaded" || this.readyState == "complete")) { |
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 inspect = require('eyes').inspector({ | |
styles: { | |
all: 'cyan', | |
label: 'underline', | |
other: 'inverted', | |
key: 'bold', | |
special: 'grey', | |
string: 'green', | |
number: 'magenta', | |
bool: 'blue', |
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('sugar'); | |
var connect = require('connect'); | |
var http_cache = { | |
http_cache_enabled: true, | |
http_cached: function(req, res, resource, callback) { | |
if (this.changed(req, res, resource)) { |
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 caller_path = undefined; // ...but...but no known native way in Node.js to know what file that triggered the current method.... ='( | |
try { | |
// ...so let's break some code of honors! >:) | |
throw Error(); | |
} catch (err) { | |
var stack_lines = err.stack.split('\n'), | |
found_this = false; |
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
# SOURCE: | |
# - http://hedgehogshiatus.com/upgrade-virtualbox-guest-additions-in-a-vargr | |
# - http://software.darrenthetiger.com/2012/01/installing-virtualbox-guest-additions-on-a-vagrant-lucid64-box | |
$ vagrant ssh | |
vagrant@box:~$ wget -q -O - https://raw.github.com/gist/3160742/vagrant-guest_additions-upgrade.sh | sh | |
$ vagrant halt | |
$ vagrant package |
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
echo "I drive up and down harlem blocks, iced out watch. Knots in my socks, cops think I'm selling rocks. Pulling me over too see if I'm drunk. But I'm sober they wouldn't fuck with me if I drove a nova. Listen columbo you're mad because your money come slow. And what you make in a year I make in one show. Now you wanna frisk me and search my ride. Call me all kinda names try to hurt my pride. You're just mad cause I'm a young cat, pockets dumb fat. Talkin bout where the gun at, I been there and done that. I'm through with that illegal life, I'm stayin legit. I love to see cars come cruisin bye and playin my shit. I walk around with six thou' without a pist-al, my whole click's wild. I'm rich pal, no more sticks I'm makin hits now. I drink cristal, I'm through breakin laws. I don't sell coke anymore, I do tours. So get that flashlight out of my face. To bring me down them jakes'll do whatever it takes. Word up them federals got my phone and my house tapped. Praying that I fall for the mouse trap, I doubt that |
OlderNewer