Skip to content

Instantly share code, notes, and snippets.

@ttscoff
ttscoff / tp-dailylog.rb
Created February 26, 2012 04:33
Daily background logger to write completed TaskPaper tasks (system-wide) to a Day One entry
#!/usr/bin/ruby
# tp-dailylog.rb - Log TaskPaper tasks completed on the current day to a Day One entry
# Brett Terpstra 2012 <http://brettterpstra.com>
#
# Run it with launchd at 11pm and forget about it
#
# Notes:
# * Uses `mdfind` to locate all .taskpaper files changed in the last day
# * Scans for @done(xxxx-xx-xx) tags in each line matching today's date
# * Does not alter TaskPaper files in any way
@seyhunak
seyhunak / simple_form.rb
Created December 14, 2011 23:17
Using simple_form and integrating Twitter Bootstrap
1. Use latest build
gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'
2. Create an initializer
# /config/initializers/simple_form.rb
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a complete input.
# You can remove any component from the wrapper, change the order or even
#! /usr/bin/env ruby
# this is best practice for writing mixins. the deferred evaluation is more
# powerful that the approach of ClassMethods/InstanceMethods as modules too
#
module Mixin
# put your class level code in here
#
ClassMethods = proc do