This file contains hidden or 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 total hack | |
# For some reason, somewhere in the murky depths of the CCW | |
# lies some code that makes ActionMailer's :date header act | |
# like a Date instead of a DateTime. Since Date isn't aware of Time | |
# :date looks like "Thu, 03 Mar 2011 00:00:00 +0000" instead of | |
# "Thu, 03 Mar 2011 13:52:57 -0500". | |
# | |
# Since we're in EST (-5 GMT), email clients subtract five hours from | |
# "midnight" (in this case), so all emails look like they were sent/received | |
# "yesterday at 7pm". |
This file contains hidden or 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 total hack | |
# For some reason, somewhere in the murky depths of the CCW | |
# lies some code that makes ActionMailer's :date header act | |
# like a Date instead of a DateTime. Since Date isn't aware of Time | |
# :date looks like "Thu, 03 Mar 2011 00:00:00 +0000" instead of | |
# "Thu, 03 Mar 2011 13:52:57 -0500". | |
# | |
# Since we're in EST (-5 GMT), email clients subtract five hours from | |
# "midnight" (in this case), so all emails look like they were sent/received | |
# "yesterday at 7pm". |
This file contains hidden or 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
source 'http://rubygems.org' | |
gem 'rails' | |
gem 'haml' | |
gem 'jquery-rails' | |
gem 'devise' | |
gem 'inherited_resources' | |
gem 'hoptoad_notifier' | |
gem 'paperclip' | |
gem 'aws-s3' |
This file contains hidden or 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
Knockout | JMVC | Backbone | |
Hours Spent: 10 3 5 | |
Documentation: B B C | |
Frustration Level: 6 3 9 | |
MVC: N Y Y | |
MVVM: Y N N | |
Opinionated Rank: 2 1 3 |
This file contains hidden or 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
$('document').ready(function(){ | |
var slider = { | |
visible: ko.observable(false), | |
toggle: function(){ | |
if(this.visible()){ | |
this.hide(); | |
this.visible(false); | |
} else { | |
this.show(); |
This file contains hidden or 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 | |
mount_point=/mnt/offsite | |
backup_device=/dev/sda1 | |
log=/var/log/offsite_backup.log | |
mount $backup_device $mount_point | |
if df | grep -q $mount_point | |
then |
This file contains hidden or 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 resource I use to upload to the server is named ExternalDownload. I upload to the server, | |
# insert a new DJ queue entry that calls this bit of code that lives in config/initializers. | |
require 'aws/s3' | |
class FileUploader | |
attr_accessor :external_download_id, :s3_config | |
def initialize(external_download_id) | |
s3_config_path = RAILS_ROOT + '/config/amazon_s3.yml' |
This file contains hidden or 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
restful_acl_test_app_rails3 |
This file contains hidden or 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
/* On page load… */ | |
$('document').ready(function(){ | |
/* Disable all submit buttons when form submitted */ | |
$(":form").submit(function(){ | |
$(":submit").attr({"disabled": true, "value": "Working…"}); | |
}); | |
$(window).bind("ajaxSend", function(){ | |
$("#spinner").show(); |
This file contains hidden or 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 showTweets(){ | |
var target = $("#twitter"); | |
var url = "http://twitter.com/statuses/user_timeline/USERNAME.json?callback=?&count=5" | |
var tweets = new Array(); | |
target.html("Loading Tweets..."); | |
$.getJSON(url, function(data) { | |
target.html(""); |