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 DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
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 DateHelper = { | |
// Takes the format of "Jan 15, 2007 15:45:00 GMT" and converts it to a relative time | |
// Ruby strftime: %b %d, %Y %H:%M:%S GMT | |
time_ago_in_words_with_parsing: function(from) { | |
var date = new Date; | |
date.setTime(Date.parse(from)); | |
return this.time_ago_in_words(date); | |
}, | |
time_ago_in_words: function(from) { |
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
$.getJSON("http://github.com/api/v1/json/tejo?callback=?", function(data){ | |
$('#loader').remove(); | |
$.each(data.user.repositories, function(i,repo){ | |
$('#ghbadge').append('<li><a title="'+repo.description+'" href="'+repo.url+'" target="blank">'+repo.name+'</a></li>'); | |
}); | |
//$('#ghbadge > li').slideDown(); | |
}); |
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
$.getJSON("http://github.com/api/v1/json/tejo?callback=?", function(data){ | |
$('#loader').remove(); | |
$.each(data.user.repositories, function(i,repo){ | |
$('#ghbadge').append('<li><a title="'+repo.description+'" href="'+repo.url+'" target="blank">'+repo.name+'</a></li>'); | |
}); | |
}); |
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
$.getJSON("http://github.com/api/v1/json/tejo?callback=?", function(data){ | |
$('#loader').remove(); | |
$.each(data.user.repositories, function(i,repo){ | |
$('#ghbadge').append('<li><a title="'+repo.description+'" href="'+repo.url+'" target="blank">'+repo.name+'</a></li>'); | |
}); | |
}); |
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
sudo bash -c "ARCHFLAGS='-arch i386' gem install mysql -- \ | |
--with-mysql-config=/usr/local/mysql/bin/mysql_config" | |
//http://dev.mysql.com/get/Downloads/MySQL-5.1/mysql-5.1.31-osx10.5-x86.dmg/from/pick |
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 | |
# Unattended REE/Passenger installation with nginx | |
if [ "$(whoami)" != "root" ]; then | |
echo "You need to be root to run this!" | |
exit 2 | |
fi | |
VERSION="1.2" |
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
# Quick wrapper for undocumented and unsupported MyMileMarker.com API | |
require 'rubygems' | |
gem 'httparty', '>= 0.3.1' | |
require 'httparty' | |
module MyMileMarker | |
class Client | |
include HTTParty | |
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
# Monkey-patch for Passenger to use the EventMachine reactor. | |
# This allows the use of EM timers, EM.system/popen, and other async libraries (amqp, em-http-request, etc) inside a Rails process. | |
# This requires EM.watch which was added to EM's git repo recently. Build an EM gem first: | |
# git clone git://github.com/eventmachine/eventmachine | |
# cd eventmachine | |
# gem build eventmachine.gemspec | |
# sudo gem install eventmachine-0.12.9.gem | |
# Please do not use this in production =) |
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
begin | |
# check if memcached is running; if it is, use that instead of the default memory cache | |
Timeout.timeout(0.5) { TCPSocket.open("localhost", 11211) { } } | |
config.cache_store = :mem_cache_store, %w(localhost:11211), { :namespace => 'OI', :timeout => 60 } | |
$stderr.puts "Using memcached on localhost:11211" | |
rescue StandardError | |
config.cache_store = nil | |
$stderr.puts "memcached not running, caching to memory" | |
end |
OlderNewer