Skip to content

Instantly share code, notes, and snippets.

View hrp's full-sized avatar

Hiten Parmar hrp

View GitHub Profile
@hrp
hrp / emojibomb.rb
Last active August 29, 2015 13:55 — forked from cobyism/emojibomb.rb
#!/usr/bin/env ruby
require 'rubygems'
require 'open-uri'
require 'nokogiri'
# Run `emojibomb` to get three emoji.
# Run `emojibomb N`, where `N` is a positive integer to get N emoji.
doc = Nokogiri::HTML(open("http://www.emoji-cheat-sheet.com/"))
emoji = doc.css('.name')
build_package_combined_patch() {
local package_name="$1"
{
curl https://raw.github.com/skaes/rvm-patchsets/master/patchsets/ruby/1.9.3/p448/railsexpress | xargs -I % curl https://raw.github.com/skaes/rvm-patchsets/master/patches/ruby/1.9.3/p448/% | patch -p1
autoconf
./configure --prefix="$PREFIX_PATH" $CONFIGURE_OPTS
make -j 8
make install
} >&4 2>&1

ruby-1.9.3-p392 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p392 with the railsexpress patchsets: https://github.com/skaes/rvm-patchsets

Requirements

You will also need a C Compiler. If you're on Linux, you probably already have one or know how to install one. On OS X, you should install XCode, and brew install autoconf using homebrew.

@hrp
hrp / 0-readme.md
Created October 30, 2013 21:33 — forked from mattyoho/0-readme.md

Patched ruby 1.9.3-p125 for 30% faster rails boot

What is?

This script installs a patched version of ruby 1.9.3-p125 with patches to make ruby-debug work again (#47) and boot-time performance improvements (#66 and #68), and runtime performance improvements (#83 and #84). It also includes the new backported GC from ruby-trunk.

Huge thanks to funny-falcon for the performance patches.

module MyModule
# Regenerating code
end unless __FILE__ == $0
if __FILE__ == $0
require 'savon'
split_on = "#" + " Regenerating code"
code = File.read(__FILE__).split(split_on).last
wsdl_file_path = File.join(File.dirname(__FILE__), ARGV.first || raise("Gimme file!"))
@hrp
hrp / fakeout.rake
Created January 14, 2012 21:46 — forked from matthutchinson/fakeout.rake
fakeout.rake - a simple/configurable rake task that generates some random fake data for the app (using faker) at various sizes
# a simple/configurable rake task that generates some random fake data for the app (using faker) at various sizes
# NOTE: requires the faker or ffaker gem
# sudo gem install faker - http://faker.rubyforge.org
# OR
# sudo gem install ffaker - http://github.com/EmmanuelOga/ffaker
require 'faker'
class Fakeout
require 'terminal-table/import'
array = [[1,2,3,4],[5,6,7,8],[9,10,11,12]]
t = table do
array.each do |a|
add_row a
end
end
puts t
#!/usr/bin/env ruby
git_bundles = [
"git://github.com/astashov/vim-ruby-debugger.git",
"git://github.com/msanders/snipmate.vim.git",
"git://github.com/scrooloose/nerdtree.git",
"git://github.com/timcharper/textile.vim.git",
"git://github.com/tpope/vim-cucumber.git",
"git://github.com/tpope/vim-fugitive.git",
"git://github.com/tpope/vim-git.git",
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal