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 < ActiveRecord::Base | |
attr_accessible :name, :email, :password, :password_confirmation, :lvl, :xp, :hp, :ap, :max_xp, :max_hp, :max_ap, :type | |
has_secure_password | |
before_save { email.downcase! } | |
before_save :create_remember_token | |
validates :name, presence: true, length: { maximum: 50 } | |
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i | |
validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, |
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
/* Services */ | |
//app | |
angular | |
.module('support', ['supportService']) | |
.config(['$routeProvider', function($routeProvider){ | |
$routeProvider | |
.when('/p/:start', {templateUrl: '/partials/warrantyList.html', controller: SupportListController}) | |
.when('/v/:field/:id/', {templateUrl: '/partials/warrantyDetails.html', controller: SupportDetailController}) | |
.otherwise({redirectTo: '/p/1'}); |
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
Start here: | |
http://warwickp.com/2012/03/vagrant-box-with-graphite-statsd-gdash-nginx |
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
namespace :bundler do | |
desc 'bundler install' | |
task :install do | |
run("gem install bundler --source=http://gemcutter.org") | |
end | |
desc 'bundler symlink vendor' | |
task :symlink_vendor do | |
shared_gems = File.join(shared_path, 'vendor/bundler_gems') | |
release_gems = "#{release_path}/vendor/bundler_gems/" |
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
// Data | |
[ | |
{"_id":"pvg:IHC09A","_rev":"1-3881006720","nvic":"IHC09A","family":"159","couchrest-type":"GRD::Pvg","make":"ALFA ROMEO"}, | |
{"_id":"pvg:IJU09A","_rev":"1-243536901","nvic":"IJU09A","family":"147","couchrest-type":"GRD::Pvg","make":"ALFA ROMEO"}, | |
{"_id":"pvg:IJV09A","_rev":"1-3794903136","nvic":"IJV09A","family":"147","couchrest-type":"GRD::Pvg","make":"ALFA ROMEO"}, | |
{"_id":"pvg:IJY09A","_rev":"1-1301614913","nvic":"IJY09A","family":"147","couchrest-type":"GRD::Pvg","make":"ALFA ROMEO"}, | |
{"_id":"pvg:J3X09A","_rev":"1-1398113861","nvic":"J3X09A","family":"V8","couchrest-type":"GRD::Pvg","make":"ASTON MARTIN"} | |
] | |
// Map |
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
function(doc) { | |
if ( doc["couchrest-type"] == "Account" ) { | |
emit(doc._id, ["Account", doc]); | |
} | |
if ( doc["couchrest-type"] == "Contact" ) { | |
emit(doc.account_id, ["Contact", doc]); | |
} | |
} |
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
# Embedded Value for DataMapper (http://martinfowler.com/eaaCatalog/embeddedValue.html) | |
class Address | |
include DataMapper::EmbeddedValue | |
property :street, String | |
property :location, String | |
property :region, String | |
property :country, String | |
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
Structure | |
========= | |
Form | |
Fields | |
Elements | |
Label (optional but most common) | |
Element | |
Label (optional in case of a a checkbox or radio) | |
Input Checkbox/Radio |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> | |
<title>Test2</title> | |
<link rel="stylesheet" type="text/css" media="all" href="css/uncompressed/reset.css" /> | |
<link rel="stylesheet" type="text/css" media="all" href="css/uncompressed/960.css" /> | |
<link rel="stylesheet" type="text/css" media="all" href="css/master.css" /> | |
</head> |
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
task :check_revision do | |
unless `git rev-parse HEAD` == `git rev-parse origin/master` | |
puts "" | |
puts " \033[1;33m**************************************************\033[0m" | |
puts " \033[1;33m* WARNING: HEAD is not the same as origin/master *\033[0m" | |
puts " \033[1;33m**************************************************\033[0m" | |
puts "" | |
end | |
end |
NewerOlder