This file contains hidden or 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
find . -name ".git" -exec rm -rf {} \; |
This file contains hidden or 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 | |
# This is intended for the I18n SimpleBackend. It checks to see that every string | |
# is translated. Running this script will output a list of translation keys that | |
# are remaining to be translated. | |
# The script only checks your custom translations. It does not check the Rails | |
# translations too. If you want to do that just remove the I18n.load_path = ... | |
# The script expects: |
This file contains hidden or 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
Steps to migrate a Rails 2.3 project to bundler. | |
1. Install bundler | |
gem install bundler | |
2. Remove existing vendor gems directory | |
rm -rf vendor/gems |
This file contains hidden or 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
=INFO REPORT==== 2010-02-16 04:51:40 === | |
D(<0.199.0>:ejabberd_receiver:320) : Received XML on stream = "<message type=\"chat\" id=\"purple45d00c31\" to=\"[email protected]\" from=\"[email protected]/Adium18999378\"><body>fasdf</body><html xmlns=\"http://jabber.org/protocol/xhtml-im\"><body xmlns=\"http://www.w3.org/1999/xhtml\"><span style=\"font-family: Helvetica; font-size: medium; background: #ffffff;\">fasdf</span></body></html><nos:x value=\"disabled\" xmlns:nos=\"google:nosave\"/><arc:record otr=\"false\" xmlns:arc=\"http://jabber.org/protocol/archive\"/></message>" | |
=INFO REPORT==== 2010-02-16 04:51:40 === | |
D(<0.199.0>:shaper:61) : State: {maxrate,50000,193.68630641370012, | |
1266295899126721}, Size=455 | |
M=4.558829829111692, I=1420.107 | |
=INFO REPORT==== 2010-02-16 04:51:40 === |
This file contains hidden or 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
conorhunt:~$ gem install json | |
Fetching: json-1.5.1.gem (100%) | |
Building native extensions. This could take a while... | |
Successfully installed json-1.5.1 | |
1 gem installed | |
conorhunt:~$ irb | |
rbx-2.0.0pre :001 > require 'json' | |
TypeError: wrong argument type NilClass (expected Module) | |
from Rubinius::NativeMethod.load_extension at kernel/common/native_method.rb:43 | |
from Rubinius::CodeLoader#load_library at kernel/delta/codeloader.rb:180 |
This file contains hidden or 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
http { | |
... | |
proxy_cache_path /data/perch.squaremill.com/shared/image_cache levels=1:2 keys_zone=images:10m; | |
... | |
} |
This file contains hidden or 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
<% form_for(@blog_post) do |f| %> | |
<%= link_to 'Preview', '#', data: {preview: true, model: @blog_post.class.to_s} %> | |
<%= f.text_area :body %> | |
<%= f.submit %> | |
<% end %> |
This file contains hidden or 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
Rake::Task["db:structure:dump"].enhance do | |
path = Rails.root.join('db', 'structure.sql') | |
file = File.read(path) | |
file.gsub!(/ AUTO_INCREMENT=\d*/, '') | |
# remove all comment lines | |
file.gsub!(/^--.*/,'') | |
File.write(path, file) | |
end |
This file contains hidden or 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
namespace :db do | |
namespace :migrations do | |
task :archive do | |
considered_old = 60 # how many days ago is considered old enough | |
puts "Looking for migrations older than #{considered_old} days" | |
db_path = File.join(Rails.root, "db/") | |
migrations_path = File.join(db_path, "migrate/") | |
old_migrations_path = File.join(db_path, "old_migrations/") | |
files = Dir[File.join(migrations_path, "/*.rb")] |
This file contains hidden or 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 "uri" | |
require "time" | |
require "openssl" | |
# Calculate v4 AWS sig | |
class AWSV4Sig | |
def initialize(access_key, secret_key) | |
@access_key = access_key | |
@secret_key = secret_key | |
end |
OlderNewer