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 Object | |
def this_method | |
caller[0]=~/`(.*?)'/ | |
$1 | |
end | |
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
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |
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 ActiveRecord::ConnectionAdapters | |
class MysqlAdapter | |
alias_method :execute_without_retry, :execute | |
def execute(*args) | |
execute_without_retry(*args) | |
rescue ActiveRecord::StatementInvalid => e | |
if e.message =~ /server has gone away/i | |
warn "Server timed out, retrying" | |
reconnect! |
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
From 4df22d595120e6eef596ebf10e36458b2a88e958 Mon Sep 17 00:00:00 2001 | |
From: Rob Anderton <[email protected]> | |
Date: Tue, 30 Mar 2010 16:44:52 +0100 | |
Subject: [PATCH 1/3] fix problems with newer versions of test/unit | |
--- | |
test/helper.rb | 3 +++ | |
1 files changed, 3 insertions(+), 0 deletions(-) | |
diff --git a/test/helper.rb b/test/helper.rb |
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
<html> | |
<head> | |
<title>Fetch Image</title> | |
<script type="text/javascript" src="index.js"></script> | |
<link href="index.css" rel="stylesheet" type="text/css"/> | |
</head> | |
<body> | |
<h3>Fetch Image From URL:</h3> | |
<div style='font-weight:bold'>Title</div> | |
<input id="imgTitle" type="text"></input> |
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
<?xml version="1.0" encoding="utf-8"?> | |
<resources> | |
<string name="app_name">AudioBox</string> | |
<string name="app_desc">Official AudioBox.fm cloud player for Android</string> | |
<string name="username_label">Email</string> | |
<string name="password_label">Password</string> | |
<string name="save_button_label">Save</string> | |
<string name="config_username">username</string> |
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
# If your workers are inactive for a long period of time, they'll lose | |
# their MySQL connection. | |
# | |
# This hack ensures we re-connect whenever a connection is | |
# lost. Because, really. why not? | |
# | |
# Stick this in RAILS_ROOT/config/initializers/connection_fix.rb (or somewhere similar) | |
# | |
# From: | |
# http://coderrr.wordpress.com/2009/01/08/activerecord-threading-issues-and-resolutions/ |
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 Task < ActiveRecord::Base | |
belongs_to :category | |
belongs_to :project | |
validates_presence_of :project_id, :category_id | |
validates_with OvertimeValidator | |
scope :of_date, lambda { |date| where(:date => date) } | |
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
require 'omniauth/core' | |
require 'digest/md5' | |
require 'rest-client' | |
require 'multi_json' | |
module OmniAuth | |
module Strategies | |
class Lastfm | |
include OmniAuth::Strategy |
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
source "http://rubygems.org" | |
# Framework | |
gem "rails", :git => "git://github.com/rails/rails.git", :branch => "3-1-stable" | |
gem "mysql2", :git => "git://github.com/brianmario/mysql2.git" | |
# Asset template engines | |
gem "sass"#, :git => "git://github.com/nex3/sass.git" | |
gem "sass-rails", :git => "git://github.com/rails/sass-rails.git" | |
gem "coffee-script"#, :git => "git://github.com/jashkenas/coffee-script.git" |