rake db:drop db:setup db:schema:dump # Ensure the database is consistent with base branch
git rebase $base_branch
git checkout --ours db/schema.rb
git add db/schema.rb
| mkdir sqpaymentform-nodejs-starterkit | |
| cd sqpaymentform-nodejs-starterkit | |
| curl https://raw.githubusercontent.com/hukid/sqpaymentform-nodejs-starterkit/master/app.js -o app.js | |
| curl https://raw.githubusercontent.com/hukid/sqpaymentform-nodejs-starterkit/master/index.html -o index.html | |
| curl https://raw.githubusercontent.com/hukid/sqpaymentform-nodejs-starterkit/master/sqpaymentform.css -o sqpaymentform.css | |
| curl https://raw.githubusercontent.com/hukid/sqpaymentform-nodejs-starterkit/master/sqpaymentform.js -o sqpaymentform.js | |
| curl https://raw.githubusercontent.com/hukid/sqpaymentform-nodejs-starterkit/master/package.json -o package.json | |
| npm install |
| # see https://github.com/ivantsepp/aasm_graph/blob/master/bin/aasm_graph | |
| Pry::Commands.helpers { | |
| def dot_template(edges) | |
| <<-DOT | |
| digraph cronjob { | |
| rankdir=LR; /* This should be configurable */ | |
| node [shape = circle]; | |
| #{edges} | |
| } | |
| DOT |
| [cuba](http://cuba.is/) for basic routing logic on top of Rack | |
| [mote](https://github.com/soveran/mote) for templating |
A curated list by Eric Elliott and friends. Suggest links in the gist comments.
Help us turn this into a proper website!
This is a very exclusive collection of only must-have JavaScript links. I'm only listing my favorite links. Nothing else makes the cut. Feel free to suggest links if you think they're good enough to make this list. The really curious should feel free to browse the comments to find other links. I can't guarantee the quality of links in the comments.
| require 'rspec' | |
| class Array | |
| def binary_search(value, index = 0) | |
| middle = self[size/2] | |
| if middle == value | |
| index + size/2 | |
| elsif size == 1 | |
| -1 | |
| elsif middle < value |
| # run with rspec [name of file] | |
| require 'rspec' | |
| class Node | |
| attr_reader :value, :children | |
| def initialize value | |
| @value = value | |
| @children = [] |
| ## Prepare ################################################################### | |
| # Remove RVM | |
| rvm implode | |
| # Ensure your homebrew is working properly and up to date | |
| brew doctor | |
| brew update | |
| ## Install ################################################################### |
| #!/usr/bin/env zsh | |
| echo ">>>Tweaking system settings for a more pleasurable experience..." | |
| echo ">>>Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)" | |
| defaults write NSGlobalDomain AppleKeyboardUIMode -int 3 | |
| echo ">>>Enable subpixel font rendering on non-Apple LCDs" | |
| defaults write NSGlobalDomain AppleFontSmoothing -int 2 |
If you're writing web applications with Ruby there comes a time when you might need something a lot simpler, or even faster, than Ruby on Rails or the Sinatra micro-framework. Enter Rack.
Rack describes itself as follows:
Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.
Before Rack came along Ruby web frameworks all implemented their own interfaces, which made it incredibly difficult to write web servers for them, or to share code between two different frameworks. Now almost all Ruby web frameworks implement Rack, including Rails and Sinatra, meaning that these applications can now behave in a similar fashion to one another.
At it's core Rack provides a great set of tools to allow you to build the most simple web application or interface you can. Rack applications can be written in a single line of code. But we're getting ahead of ourselves a bit.