This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install with: | |
# bash < <(curl -L https://raw.github.com/gist/1754122) | |
# | |
# Reference: http://blog.wyeworks.com/2011/11/1/ruby-1-9-3-and-ruby-debug | |
# | |
# Update to work with the falcon patch. | |
echo "Installing ruby-debug with ruby-1.9.3-p0 ..." | |
curl -OL http://rubyforge.org/frs/download.php/75414/linecache19-0.5.13.gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Viewpoint::EWS::EWS.endpoint = 'https://webmail.sherweb2010.com/EWS/Exchange.asmx' | |
class << self | |
# Authenticate against @Wordnik.com Email account | |
# Viewpoint::EWS::EWS.set_auth('DOMAIN\alex_wordnik.com','password') | |
def authenticate(user, password) | |
user = user.downcase.strip | |
exchange_user = "DOMAIN\\#{user}_wordnik.com" | |
Rails.logger.debug "Authenticate for Exchange User #{exchange_user}" | |
Viewpoint::EWS::EWS.set_auth exchange_user, password |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
if(typeof(console) == 'undefined') { | |
(function() { | |
/* Shim for window.console */ | |
var methods = ['log', 'info', 'warn', 'error']; | |
window.console = {}; | |
for(var i = 0; i < methods.length; i++){ | |
window.console[ methods[i] ] = function() {}; | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alexle:pushpuppy sr3d$ vmc push pushpuppy --runtime ruby19 | |
Would you like to deploy from the current directory? [Yn]: | |
Application Deployed URL: 'pushpuppy.cloudfoundry.com'? | |
Detected a Rails Application, is this correct? [Yn]: | |
Memory Reservation [Default:256M] (64M, 128M, 256M, 512M or 1G) | |
Creating Application: OK | |
Would you like to bind any services to 'pushpuppy'? [yN]: y | |
Would you like to use an existing provisioned service [yN]? N | |
The following system services are available:: | |
1. mongodb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
desc "Removes trailing whitespace and replaces tabs with two spaces" | |
task :whitespace do | |
sh %[find . \\( -name '*.rb' -or -name '*.yml' \\) -type f -exec ruby -pi -e 'gsub(/ +$/, "");gsub(/\t/, " ")' {} \\;] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cachedFiles = {}; | |
/* load a file and cache it so next time we don't have to re-evaluate again */ | |
function load(path) { | |
if(!cachedFiles[path] || DEBUG ){ | |
log('caching ' + path ); | |
cachedFiles[path] = require(path); | |
}; | |
return cachedFiles[path]; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Celltrust | |
class Sms < Struct.new( :number, :message, :sms_id, :status ) | |
@@count = 0 | |
URL = 'https://www.primemessage.net/TxTNotify/SecureSMS' | |
def self.count | |
@@count | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TinyORM = (function(options) { | |
/* a hash containing all the available models */ | |
var Models = {}; | |
var connection = null; | |
var config = _.extend({ | |
/* The name of the database which Ti will open. The local db is located at: | |
~/Library/Application Support/iPhone Simulator/4.2/Applications/APP_ID/Library/Application Support/database/dbname | |
*/ | |
dbname: 'add.db', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function log(object) { | |
Ti.API.debug(object); | |
if(logger) { | |
logger.log(object); | |
}; | |
}; | |
var indWin = null; | |
var actInd = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var listenOnce = function(event, handler) { | |
var handlerWrapper = function() { | |
handler(); | |
Ti.App.removeEventListener(event, handlerWrapper); | |
}; | |
Ti.App.addEventListener(event, handlerWrapper); | |
}; | |
var listenButUnregisterWhenClose = function( win, hash ) { | |
_.each(hash, function(handler, event) { |