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
#Deploy and rollback on Heroku in staging and production | |
task :deploy_staging => ['deploy:set_staging_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
task :deploy_production => ['deploy:set_production_app', 'deploy:push', 'deploy:restart', 'deploy:tag'] | |
namespace :deploy do | |
PRODUCTION_APP = 'YOUR_PRODUCTION_APP_NAME_ON_HEROKU' | |
STAGING_APP = 'YOUR_STAGING_APP_NAME_ON_HEROKU' | |
task :staging_migrations => [:set_staging_app, :push, :off, :migrate, :restart, :on, :tag] | |
task :staging_rollback => [:set_staging_app, :off, :push_previous, :restart, :on] |
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
// decompressXML -- Parse the 'compressed' binary form of Android XML docs | |
// such as for AndroidManifest.xml in .apk files | |
int endDocTag = 0x00100101; | |
int startTag = 0x00100102; | |
int endTag = 0x00100103; | |
public void decompressXML(byte[] xml) { | |
// Compressed XML file/bytes starts with 24x bytes of data, | |
// 9 32 bit words in little endian order (LSB first): | |
// 0th word is 03 00 08 00 |
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 'formula' | |
class Screen <Formula | |
homepage 'http://www.gnu.org/software/screen/' | |
url 'http://ftp.gnu.org/gnu/screen/screen-4.0.3.tar.gz' | |
md5 '8506fd205028a96c741e4037de6e3c42' | |
# brew install --HEAD to get the latests, includes vertical split, mapped | |
# to C-a | | |
head 'git://git.savannah.gnu.org/screen.git', :branch => 'master' |
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 'date' | |
require 'bigdecimal/newton' | |
require 'bigdecimal/math' | |
include Newton | |
class XIRR | |
def initialize(datevalues) | |
@datevalues = datevalues | |
@zero = BigDecimal::new("0.0") |
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 ActionView | |
module Helpers | |
module FormHelper | |
def text_area(object_name, method, options = {}) | |
html = InstanceTag.new(object_name, method, self, options.delete(:object)).to_text_area_tag(options) | |
html.gsub(/>\
/, '>').html_safe | |
end | |
end | |
end | |
end |