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
port = 8085 |
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 |