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
This is a flipping file | |
Barg! | |
This is a frikin RAD tool |
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
protected function mySFTP($source_file, $destination_file){ | |
if(!$this->connection) return false; | |
$sftp = ssh2_sftp($this->connection); | |
$sftpStream = fopen("ssh2.sftp://{$sftp}{$destination_file}", 'wb'); | |
if($sftpStream) stream_set_blocking($sftpStream, true); | |
else return false; | |
try { | |
if (!$sftpStream) | |
throw new Exception("Could not open remote file: $destination_file"); |
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
# this works very nicely | |
def self.authenticate(email, password) | |
user = self.find_by_email(email) | |
locked_for_x_seconds = 0 | |
if user && user.account_locked_until && Time.now < user.account_locked_until | |
locked_for_x_seconds = (user.account_locked_until - Time.now).round | |
user = nil | |
end | |
if user | |
expected_password = encrypted_password(password, user.salt) |
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
Merb.logger.info("Compiling routes...") | |
Merb::Router.prepare do | |
resources :posts do | |
resources :comments | |
end | |
#resources :categories | |
#r.match("/posts/:id/add_comment", method => :post). | |
# to(:controller => "posts", :action => "add_comment").name(:post_add_comment) |
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
# The following responds to: | |
# /locations/nearby/45.513906/-122.645548 | |
# /locations/nearby/45.513906/-122.645548/100 | |
# /locations/nearby/45.513906/-122.645548/100/5 | |
# /locations/nearby/45.513906/-122.645548/100/5.xml | |
# The following urls work now: | |
# /locations/nearby/45.513906/-122.645548.xml | |
# /locations/nearby/45.513906/-122.645548/100.xml | |
# | |
# :range and :limit are intended to be optional |
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
#!/bin/bash | |
# This script synchronizes the luminis files on this server with the live luminis server | |
# remote dir on the luminis server | |
luminis_dir="/u01/luminis/webapps/luminis/www/CC/" | |
# The following variables change based on server running this script | |
this_dir="/var/www/luminis_sync" | |
local_luminis_files="/var/www/html/cake/app/webroot/files/luminis_base/*" | |
# derived variables |
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
class Favorite < ActiveRecord::Base | |
# Uses composite_primary_keys gem: http://compositekeys.rubyforge.org/ | |
set_primary_keys :user_id, :location_id | |
belongs_to :user | |
belongs_to :location | |
validates_uniqueness_of :user_id, :scope => :location_id | |
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
/* Firefox Google By Date bookmark by Sean McCleary | |
* I love to search google with a date criteria, but I always was upset with the advanced search interface | |
* To use this, in Firefox, Go to Bookmarks->Organize Bookmarks...->Bookmarks Menu. Then, add new bookmark. | |
* Name: Google by Date | |
* Location: <copy and paste javascript below in this field> | |
* Keyword: gbd | |
* | |
* Useage Example: Say you wanted to search for "funny lolcats" and you only want to see results from the last 5 weeks. | |
* type in Firefox's location bar | |
* gbd funny lolcats w5 |
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
+ case "$action" in | |
+ rvm-use ruby 1.9 | |
+ implementation=ruby | |
+ case "$implementation" in | |
+ '[' 1.9 = 1.8.7 ']' | |
+ '[' 1.9 = 1.8.6 -o 1.9 = 1.8 ']' | |
+ '[' 1.9 = 1.9.2 ']' | |
+ '[' 1.9 = 1.9.1 -o 1.9 = 1.9 ']' | |
+ level=243 | |
+ MY_RUBY_HOME=/Users/sean/.rvm/ruby-1.9.1-p243 |
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
# with the help of the sdoc gem, this will generate the sdocs for all | |
# of your most recent gems. | |
# Caution! This will take a long time to run if you have a lot of gems installed. | |
# set an absolute path to the directory you would like your docs generated. | |
docs_path = "/Users/sean/tmp/docs/" | |
gems_output = `gem list --local` | |
gem_list = gems_output.gsub(/^([^ ]+).*\)/, '\1').split(/\n/) | |
latest_gem_dirs = gems_output.gsub(/^([^ ]+) \(([0-9\.]+).*\)/, '\1-\2').split(/\n/) |
OlderNewer