Skip to content

Instantly share code, notes, and snippets.

View micahlisonbee's full-sized avatar

Micah Lisonbee micahlisonbee

View GitHub Profile
var browserSync = require("browser-sync");
browserSync.emitter.on("service:running", function (data) {
console.log(data); // this object will have tunnel info
});
browserSync({
server: "./app",
tunnel: true
});
@wader
wader / gist:1232562
Created September 21, 2011 16:32
Paperclip migration rename, add and remove helpers
class UserRenameAvatarToProfileRemoveAAddB < ActiveRecord::Migration
# you may want to change these
AttachmentColumns = [["file_name", :string], ["content_type", :string], ["file_size", :integer]]
# make sure this matches your setup, also have a look in the rename and remove methods
AttachmentPath = Rails.root.join("public", "system")
def self.rename_attachment(table, old, new)
AttachmentColumns.each do |suffix, type|
rename_column table, "#{old}_#{suffix}", "#{new}_#{suffix}"
end