Skip to content

Instantly share code, notes, and snippets.

View maleko's full-sized avatar

Marc Lee maleko

  • Adviso Technologies
  • Melbourne, Australia
View GitHub Profile
#!/usr/bin/env ruby
require 'rubygems'
require 'fsevents'
require 'json'
ignores = JSON.parse(File.read(".couchappignore")).map { |s| Regexp.new(s) }
ignores.push /(^.git|.DS_Store|\.swp$|\.couchappignore)/
appdir = File.expand_path(File.dirname(__FILE__))
# To truncate an sms message before the 160 character limit and not a word in mid-sentence
text.scan(/.{1,160}(?=\s|$)/m)