start new:
tmux
start new with session name:
tmux new -s myname
| # Do you ever define #method_missing and forget #respond_to? I sure | |
| # do. It would be nice if we could do them both at the same time. | |
| module MatchMethodMacros | |
| def match_method(matcher, &method_body) | |
| mod = Module.new do | |
| define_method(:method_missing) do |method_name, *args| | |
| if matcher === method_name.to_s | |
| instance_exec(method_name, *args, &method_body) | |
| else |
| ! urxvt | |
| URxvt*buffered: true | |
| URxvt*cursorBlink: true | |
| URxvt*underlineColor: yellow | |
| URxvt*font: xft:inconsolata:size=10:antialias=true | |
| URxvt*depth: 32 | |
| URxvt*borderless: 1 | |
| URxvt*scrollBar: false | |
| URxvt*loginShell: true | |
| Urxvt*secondaryScroll: true # Enable Shift-PageUp/Down in screen |
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | |
| <title>Stripe Sample Form</title> | |
| <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| <script type="text/javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.validate/1.8.1/jquery.validate.min.js"></script> | |
| <script type="text/javascript" src="https://js.stripe.com/v1/"></script> | |
| <script type="text/javascript"> |
| #!/usr/bin/env ruby | |
| # == Simple Daemon | |
| # | |
| # A simple ruby daemon that you copy and change as needed. | |
| # | |
| # === How does it work? | |
| # | |
| # All this program does is fork the current process (creates a copy of | |
| # itself) then exits, the fork (child process) then goes on to run your | |
| # daemon code. In this example we are just running a while loop with a |
| #!/bin/sh | |
| git filter-branch --env-filter ' | |
| an="$GIT_AUTHOR_NAME" | |
| am="$GIT_AUTHOR_EMAIL" | |
| cn="$GIT_COMMITTER_NAME" | |
| cm="$GIT_COMMITTER_EMAIL" | |
| if [ "$GIT_COMMITTER_EMAIL" = "[email protected]" ] |
| class Game < ActiveRecord::Base | |
| belongs_to :category | |
| validates_presence_of :title, :category_id, :description, | |
| :price, :platform, :year | |
| def price | |
| price = read_attribute(:price) | |
| unless price.present? | |
| update_attribute(:price, GamePriceService.new(self).get_price) | |
| read_attribute(:price) |
| states = Array[ ["AK", "Alaska"], | |
| ["AL", "Alabama"], | |
| ["AR", "Arkansas"], | |
| ["AS", "American Samoa"], | |
| ["AZ", "Arizona"], | |
| ["CA", "California"], | |
| ["CO", "Colorado"], | |
| ["CT", "Connecticut"], | |
| ["DC", "District of Columbia"], | |
| ["DE", "Delaware"], |
| # ~/.tmuxinator/rails_project.yml | |
| # you can make as many tabs as you wish... | |
| project_name: rails_project | |
| project_root: ~/work/rails_project | |
| pre: pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start | |
| tabs: | |
| - editor: vim | |
| - shell: | |
| layout: even-vertical |
| class ActiveRecord::Base | |
| mattr_accessor :shared_connection | |
| @@shared_connection = nil | |
| def self.connection | |
| @@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection } | |
| end | |
| end | |
| ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection |