Skip to content

Instantly share code, notes, and snippets.

View vintrepid's full-sized avatar
🌴
On vacation

Vince Nibler vintrepid

🌴
On vacation
View GitHub Profile
@vintrepid
vintrepid / setup
Created January 19, 2009 23:58 — forked from wycats/setup
sudo gem install merb --source http://edge.merbivore.com
Ruby 1.8.6 (ruby -v)
Rubygems 1.3.1 (gem -v)
gem update --system
XCode 3.x
Macports 1.700 (port version)
sudo port selfupdate
sudo port install kcachegrind
sudo port install graphviz
@vintrepid
vintrepid / turbogears setup
Created October 15, 2009 04:32
turbogears setup
sudo easy_install virtualenv
virtualenv tgtut --no-site-packages
cd tgtut
mkdir src
source bin/activate
easy_install sqlalchemy
easy_install sqlautocode
easy_install ipython
easy_install -f ../pypi/ ipython
sqlautocode sqlite:///moviedemo.db -o tables.py
@vintrepid
vintrepid / datatable superclass
Created June 15, 2012 11:55
datatable superclass that handles server side multi-column searching and sorting
# derived from http://railscasts.com/episodes/340-datatables
# handles server side multi-column searching and sorting
class Datatable
delegate :params, :h, :raw, :link_to, :number_to_currency, to: :@view
def initialize(klass,view)
@klass = klass
@view = view
end

Keybase proof

I hereby claim:

  • I am vintrepid on github.
  • I am vintrepid (https://keybase.io/vintrepid) on keybase.
  • I have a public key ASAEFjwdDlpvG4RsY0u_oh0Pr47dNNkO8ZZBX4Bh4JA8DQo

To claim this, I am signing this object:

@vintrepid
vintrepid / gist:5fc2ae80b91a60a17cd62bdd2b7a4876
Created May 3, 2018 02:52
copy child records from a duplicate activerecord object to another
class ActiveRecord::Base
def combine duplicate, update=false
Rails.logger.info "Combine #{duplicate.name} child records into #{name}..."
tbl = self.class.table_name
self.class.has_many_associations.each do |relation, refl|
assoc = ActiveRecord::Associations::HasManyAssociation.new(duplicate,refl)
scope = assoc.scope
cnt = scope.size
any = cnt > 0
Rails.logger.info "#{'combine ' if any}#{cnt} #{relation.singularize.pluralize(cnt)}"
@vintrepid
vintrepid / macOS_setup_steps.md
Created June 1, 2018 20:49 — forked from frankolson/macOS_setup_steps.md
Steps I used to setup an macOS 10.12 web development machine.

macOS 10.12 Web Development Machine

Show Library folder

$ chflags nohidden ~/Library

Show hidden files