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
while true; do find . -name '*service*' | head -1 | while read filename ; do echo $filename; mv $filename ${filename/service/addon}; done; done |
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 setup_engineyard | |
configure 'deploy', 'provider' => 'engineyard' do |config| | |
eyrc = File.expand_path(".eyrc", Dir.home) | |
if File.exists?(eyrc) | |
config['api_key'] = YAML.load_file(eyrc)["api_token"] | |
end | |
env = ask("Environment (optional): ").to_s | |
config['environment'] = env unless env.empty? | |
if agree("Run migrations on deploy? ") { |q| q.default = 'yes' } |
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
From 767031e6fc1f313b29a982dc2f315596ac97bf47 Mon Sep 17 00:00:00 2001 | |
From: Jacob Burkhart & Martin Emde <[email protected]> | |
Date: Mon, 19 Aug 2013 16:25:02 -0700 | |
Subject: [PATCH] Optimize more by not using normalized_ methods | |
--- | |
Rakefile | 9 ++++++--- | |
lib/gitable/scp_uri.rb | 10 +++++----- | |
lib/gitable/uri.rb | 5 ++--- | |
3 files changed, 13 insertions(+), 11 deletions(-) |
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 load_from_cache | |
unless File.exists?(cache_path) | |
return false | |
end | |
toload = YAML.load_file(cache_path) | |
created = {} | |
models.each do |model| | |
toload[model.name].each do |id, attributes| | |
atts = {} | |
attributes.each do |k,v| |
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 anywhere in your specfile: | |
class ReloadHax | |
def self.setup(*files_to_reload, &go_block) | |
@files_to_reload, @go_block = files_to_reload, go_block | |
end | |
def self.go | |
ApplicationController.asset_host = "http://billing.localdev.engineyard.com:3000" | |
ActionView::Resolver.caching = false | |
@files_to_reload.each{|x| load(File.join(Rails.root,x))} |
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 'flickraw' | |
FlickRaw.api_key= "SECRET" | |
FlickRaw.shared_secret="SECRET" | |
def reauth | |
token = flickr.get_request_token | |
auth_url = flickr.get_authorize_url(token['oauth_token'], :perms => 'write') | |
puts auth_url | |
verify = gets #"123-123-123" |
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
while :; do clear; git add -A; git commit -m "update"; git push origin master; sleep 2; done |
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
https://plus.google.com/events/cqkjpnv749irie3s862vtvnvkik?authkey=COeQg_2V36Wi-QE |
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
gist_it = Proc.new do |content| | |
post_body = { | |
description: "gist", | |
public: false, | |
files: { :file1 => {content: content}} | |
} | |
resp = RestClient.post "https://api.github.com/gists", post_body.to_json, {content_type: :json, accept: :json} | |
JSON.parse(resp.body)["files"]["file1"]["raw_url"] | |
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
module WithControllerHelper | |
class TestCase < ActionController::TestCase | |
def initialize(controller_class) | |
super("WithControllerHelper") | |
setup_controller_request_and_response | |
@routes = Rails.application.routes | |
@controller = controller_class.new | |
end | |
end |