Skip to content

Instantly share code, notes, and snippets.

@cschneid
cschneid / Guardfile
Created February 14, 2013 22:51 — forked from tubbo/Guardfile
guard 'bundler' do
watch('Gemfile')
end
guard 'livereload' do
watch(%r{app/views/.+\.(erb|haml|md|builder|jbuilder)})
watch(%r{app/helpers/.+\.rb})
watch(%r{public/.+\.(css|js|html)})
watch(%r{config/locales/.+\.yml})
watch(%r{(app|vendor)/assets/\w+/(.+\.(css|js|html)).*}) { |m| "/assets/#{m[2]}" }
tell application "Safari" to set recipeurl to URL of front document
tell application "Safari" to set recipetitle to name of front document
set ingredients to (do shell script "curl http://recipedistiller.com/recipe/classify/?recipeurl=" & recipeurl & " | textutil -convert txt -stdin -stdout | grep '.' | sed 's/ • DELETE //g'")
set my text item delimiters to "VIEW RECIPE"
set ingredients to text item 2 of ingredients
set my text item delimiters to "©"
set ingredients to text item 1 of ingredients
@cschneid
cschneid / default_attributes.rb
Created October 24, 2012 03:40 — forked from charlesjohnson/default_attributes.rb
Ark library usage example
default['elasticsearch']['version'] = "0.19.6"
default['elasticsearch']['checksum'] = 'f0ec550fb86c4bc8f08afb15de4e197e85f9fcfd352fbb7eb49aaff98f7731dd'
default['elasticsearch']['url'] = "http://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-#{node['elasticsearch']['version']}.tar.gz"
default['elasticsearch']['home_path'] = "/usr/lib"
default['elasticsearch']['home_dir'] = "#{node['elasticsearch']['home_path']}/elasticsearch"
@cschneid
cschneid / .gitignore
Created September 26, 2012 22:03 — forked from thinkerbot/.gitignore
Ruby sprintf from the command line.
/ronn
@cschneid
cschneid / Tests
Created August 15, 2012 19:46 — forked from coreyhaines/Tests
Number 2 LED
Create a system that will convert a numeric value to an 3x5 LED display.
...
...
...
...
...
Feature: Generating LCD representation for single numbers
@cschneid
cschneid / repeating_header.rb
Created July 31, 2012 14:00 — forked from randym/repeating_header.rb
Excel with Ruby: Printing Header Row for every page with axlsx
#```ruby
require 'axlsx'
p = Axlsx::Package.new
wb = p.workbook
wb.add_worksheet(:name => "repeated header") do |sheet|
sheet.add_row %w(These Column Header Will Render On Every Printed Sheet)
200.times { sheet.add_row %w(1 2 3 4 5 6 7 8) }
# This is the magic
wb.add_defined_name("'repeated header'!$1:$1", :local_sheet_id => sheet.index, :name => '_xlnm.Print_Titles')
@cschneid
cschneid / hack.sh
Created April 1, 2012 03:43 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#
<cschneid> jc3: convenience & future enhancements to be fancier
<cschneid> jc3: nothing pressing even in the least, just toying with ideas
[13:26]
<cschneid> found torquebox just now, totally speaks to me... seems great
<jc3> i'm intrigued by the long-running ruby process idea. jboss'
"microcontainer" already provides a lightweight "service" interface that
your bot would implement, essentially define "start" and "stop" methods.
we could probably put some syntactic sugar around that so that you could
package your service with the sinatra app. or there may already be a
way. bob knows more about the microcontainer than i. [13:29]
require 'rubygems'
require 'sinatra'
class Mobile << Sinatra::Base
get '/' do
'hello world'
end
end