Skip to content

Instantly share code, notes, and snippets.

View nilcolor's full-sized avatar
💫
API by day, IPA by night

Alexey Blinov nilcolor

💫
API by day, IPA by night
View GitHub Profile
@nilcolor
nilcolor / 0_README.md
Last active December 11, 2015 12:48
ruby-1.9.3-p374 cumulative performance patch for rbenv

ruby-1.9.3-p374 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p374 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.

ruby-1.9.3-p362 cumulative performance patch for rbenv

This installs a patched ruby 1.9.3-p362 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.

@nilcolor
nilcolor / capybara cheat sheet
Created December 7, 2012 06:36 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@nilcolor
nilcolor / gist:3781382
Created September 25, 2012 12:07 — forked from jasoncodes/gist:1223731
Installing Ruby 1.9.3 with rbenv
brew install rbenv
brew install ruby-build
brew install rbenv-vars
brew install readline
brew install ctags
echo 'eval "$(rbenv init - --no-rehash)"' >> ~/.bash_profile
exec $SHELL -i # reload the shell
CONFIGURE_OPTS="--disable-install-doc --with-readline-dir=$(brew --prefix readline)" rbenv install 1.9.3-p194
rbenv global 1.9.3-p194
gem install bundler rbenv-rehash git-up hitch gem-browse gem-ctags cheat awesome_print pry
@nilcolor
nilcolor / sublime-shortcuts.md
Last active October 10, 2015 20:48 — forked from kahlil/sublime-shortcuts.md
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 - Useful Shortcuts (Mac OS X)

General

  • ⌘T go to file
  • ⌘⌃P go to project
  • ⌘R go to methods
  • ⌃G go to line
  • ⌘KB toggle side bar
  • ⌘⇧P command prompt
@nilcolor
nilcolor / 0. nginx_setup.sh
Created August 17, 2012 08:56 — forked from mikhailov/0. nginx_setup.sh
Nginx+Unicorn
# Nginx+Unicorn best-practices congifuration guide.
# We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies.
# Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module
#
# Deployment structure
#
# SERVER:
# /etc/init.d/nginx (1. nginx)
# /home/app/public_html/app_production/current (Capistrano directory)
#
@nilcolor
nilcolor / ajax-file-upload.js
Created July 3, 2012 11:14
Upload file using FormData (a-la AJAX file upload using XMLHTTPRequest2)
function sendForm() {
var fileData = new FormData(document.getElementById("cpd-file"));
var xhr = new XMLHttpRequest();
xhr.open("POST", "/upload_file", true);
xhr.setRequestHeader('Accept', 'application/json');
xhr.onload = function(progressEvent) {
if (xhr.status == 200) {
console.log('Uploaded', xhr);
} else {
@nilcolor
nilcolor / a.rb
Created June 29, 2012 12:53
Code styles
def catch22
model = Model.create!(:field1 => product_row[:part_number],
:field2 => product_row[:element_name],
:field3 => product_row[:pattern_value],
:field4 => product_row[:fixed_dp],
:field5 => product_row[:franchise_name],
:field6 => product_row[:product_code],
:field7 => (product_row[:volume].to_i == 0 ? nil : product_row[:volume]),
:field8 => product_row[:package_quantity])
# other code...
@nilcolor
nilcolor / currencies_spec.rb
Created May 4, 2012 08:36
API spec sample
require 'spec_helper'
describe "Currency catalog API" do
let(:token) { create(:user).authentication_token }
before(:all) do
2.times { create :currency }
end
describe 'fetch the list of currencies' do
@nilcolor
nilcolor / rspec-syntax-cheat-sheet.rb
Created May 4, 2012 06:36 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")