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 User << ActiveResource | |
class ClientValidatedFields | |
attr_accessor :phone | |
include ActiveModel::Validations | |
validates :phone, :presence => true, :length => { :maximum => 10, :minimum => 10 }, :numericality => true | |
def initialize(*args) | |
(args.first.first || {}).each_pair do |k, v| | |
send("#{k}=".to_sym, v) if self.respond_to?("#{k}=".to_sym) | |
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
https://github.com/myronmarston/vcr/blob/master/lib/vcr.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
deb http://apt.opscode.com/ lucid-0.10 main |
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
global | |
maxconn 4096 | |
daemon | |
nbproc 1 | |
defaults | |
mode http | |
clitimeout 60000 | |
srvtimeout 30000 | |
contimeout 4000 | |
option httpclose |
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 | |
# Install ImageMagick on Snow Leopard (10.6) | |
# Reported to work also on Leopard (10.5) | |
# | |
# Created by Claudio Poli (http://www.icoretech.org) | |
# Configuration. | |
# Set the sourceforge.net's mirror to use. | |
SF_MIRROR="heanet" | |
# ImageMagick configure arguments. |
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
** [out :: ec2-174-129-60-95.compute-1.amazonaws.com] $ kill -s QUIT 12689 12692 12696 12686 | |
** [out :: ec2-174-129-60-95.compute-1.amazonaws.com] | |
** [out :: ec2-174-129-60-95.compute-1.amazonaws.com] Starting 1 worker(s) with QUEUE: * | |
** [out :: ec2-174-129-60-95.compute-1.amazonaws.com] | |
** [out :: ec2-174-129-60-95.compute-1.amazonaws.com] Starting 3 worker(s) with QUEUE: OMG | |
** [out :: ec2-174-129-60-95.compute-1.amazonaws.com] |
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
<div class="gist"> | |
<a href= | |
"https://gist.github.com/1870642.js?file=resque.rake">https://gist.github.com/1870642.js?file=resque.rake</a> | |
</div> |
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
# config/initializers/turn.rb | |
# this file is ignored by the gitignore file | |
if(Rails.env.test? || Rails.env.integration?) | |
files = [ | |
'/Users/kmazaika/.rvm/gems/ruby-1.9.3-p0@gem_set_name/gems/minitest-2.8.1/lib/minitest/autorun.rb', | |
'/Users/kmazaika/.rvm/gems/ruby-1.9.3-p0@gem_set_name/gems/turn-0.9.3.ken/lib/turn.rb' | |
] | |
files.each do |file| | |
$:.unshift File.dirname(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
Here's an example -- this returns the max "b" record for every "a". | |
Tyler | |
mysql> create table x (a int, b int); | |
Query OK, 0 rows affected (0.18 sec) | |
mysql> insert x values (1, 1), (1, 2), (1, 3), (2, 5), (2, 8), (3, 10); | |
Query OK, 6 rows affected (0.04 sec) | |
Records: 6 Duplicates: 0 Warnings: 0 |