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
gem install larch | |
larch --from imaps://imap.gmail.com --to imaps://imap.gmail.com --from-folder '[Gmail]/All Mail' --to-folder '[Gmail]/All Mail' |
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 | |
require File.expand_path('../../lib/themer', __FILE__) | |
Themer::CLI.start |
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
File.open("licences", "w+") do |file| | |
Bundler.environment.specs.each do |spec| | |
Dir["#{spec.full_gem_path}/LICENSE*"].each do |f| | |
file.write("======================= #{spec.name} - #{spec.version} =======================\n") | |
file.write(File.read(f)) | |
file.write("------------------------------------------------------------------------------\n #{f}\n------------------------------------------------------------------------------\n\n") | |
end | |
end | |
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
# heavily based on Masao Mutoh's gettext String interpolation extension | |
# http://github.com/mutoh/gettext/blob/f6566738b981fe0952548c421042ad1e0cdfb31e/lib/gettext/core_ext/string.rb | |
module I18n | |
INTERPOLATION_PATTERN = Regexp.union( | |
/%%/, | |
/%\{(\w+)\}/, # matches placeholders like "%{foo}" | |
/%<(\w+)>(.*?\d*\.?\d*[bBdiouxXeEfgGcps])/ # matches placeholders like "%<foo>.d" | |
) |
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 'jruby' | |
module Serialize | |
def self.serialize(obj) | |
baos = java.io.ByteArrayOutputStream.new | |
oos = java.io.ObjectOutputStream.new(baos) | |
oos.write_object(JRuby.reference(obj)) | |
oos.close | |
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
brew/apt/yum install pv |
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
% pv -cN bunzip < huge_db_snapshot.sql.bz2 | bunzip2 | pv -cN import | mysql -uroot -p database | |
Enter password: | |
bunzip: 3.75MB 0:00:07 [ 400kB/s] [> ] 0% ETA 0:19:20 | |
import: 16.9MB 0:00:08 [2.55MB/s] [ <=> ] |
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
% pv huge_db_snapshot.sql.bz2 | bunzip2 | mysql -uroot -p database | |
Enter password: | |
62.9MB 0:05:02 [ 223kB/s] [==> ] 10% ETA 0:45:02 |
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
# coding: utf-8 | |
# | |
# Encode any codepoint outside the ASCII printable range to an HTML character | |
# reference (http://bit.ly/KNupLT). | |
def encode(string) | |
string.each_codepoint.inject("") do |buffer, cp| | |
cp = "&#x#{cp.to_s(16)};" unless cp >= 0x20 && cp <= 0x7E | |
buffer << cp | |
end | |
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
source "https://rubygems.org" | |
gem 'sprockets' | |
gem 'sprockets-sass' | |
gem 'sass' | |
gem 'compass' | |
gem 'bootstrap-sass' | |
gem 'handlebars_assets' | |
gem 'coffee-script' |
NewerOlder