start new:
tmux
start new with session name:
tmux new -s myname
| require 'hirb' | |
| # don't show [created|updated|deleted]_at fields from ActiveRecord tables | |
| class Hirb::Helpers::MyActiveRecordTable < Hirb::Helpers::ActiveRecordTable | |
| def self.render(rows,opts={}) | |
| rows = [rows] unless rows.is_a?(Array) | |
| opts[:fields] = rows.first.class.columns.reject {|c| c.type == :datetime}.map {|c| c.name.to_sym} | |
| super(rows, opts) | |
| end | |
| end |
| /*! | |
| * postMessage detector - v0.1pre - 9/15/2010 | |
| * http://benalman.com/ | |
| * | |
| * Copyright (c) 2010 "Cowboy" Ben Alman | |
| * Dual licensed under the MIT and GPL licenses. | |
| * http://benalman.com/about/license/ | |
| */ | |
| // If `window.postMessage.complex` is true, postMessage can pass complex non-string |
| =speech_bubble($arrow_dir: left, $arrow_pos: 50%, $color: #efefef, $border_width: 2px, $border_color: #ccc) | |
| border-style: solid | |
| border-width: $border_width | |
| border-color: $border_color | |
| +border-radius | |
| background-color: $color | |
| position: relative | |
| overflow: visible | |
| $dir_x: right |
| module DeepFetch | |
| def deep_fetch(*keys, &fetch_default) | |
| throw_fetch_default = fetch_default && lambda {|key, coll| | |
| args = [key, coll] | |
| # only provide extra block args if requested | |
| args = args.slice(0, fetch_default.arity) if fetch_default.arity >= 0 | |
| # If we need the default, we need to stop processing the loop immediately | |
| throw :df_value, fetch_default.call(*args) | |
| } | |
| catch(:df_value){ |
just change out app_name for your purposes
openssl genrsa 2048 > app_name-wildcard.key
openssl req -new -x509 -nodes -sha1 -days 3650 -key app_name-wildcard.key > app_name-wildcard.cert
# Common Name (eg, your name or your server's hostname) []:*.app_name.com
openssl x509 -noout -fingerprint -text < app_name-wildcard.cert > app_name-wildcard.info| -- Two dashes start a one-line comment. | |
| --[[ | |
| Adding two ['s and ]'s makes it a | |
| multi-line comment. | |
| --]] | |
| ---------------------------------------------------- | |
| -- 1. Variables and flow control. | |
| ---------------------------------------------------- |
| desc "Truncate all tables in the database" | |
| task :truncate_all_tables! => :environment do | |
| unless Rails.env.production? | |
| puts "TRUNCATING ALL TABLES in 3 seconds!!!!" | |
| sleep 3 | |
| ActiveRecord::Base.connection.tables.each do |table| | |
| unless table == "schema_migrations" | |
| puts "Truncating #{table}." | |
| ActiveRecord::Base.connection.execute("TRUNCATE TABLE #{table} RESTART IDENTITY CASCADE;") | |
| else |
require 'mina/bundler'Command Line
pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)pry -r ./config/environment.rb - load your rails into a pry sessionDebugger