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 | |
include Mongoid::Document | |
field :email | |
validates_format_of :email, :with => /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,6}$/i, :message => "is not a valid email adress." | |
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
<!doctype html> | |
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]--> <!--[if IE 7 ]> <html lang="en" class="ie7"> <![endif]--> <!--[if IE 8 ]> <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9 ]> <html lang="en" class="ie9"> <![endif]--> | |
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="UTF-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="author" content=""> |
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
[11:15][jnh@Marjory]~/Dev/forks/emberjs-rails$ gem push emberjs-rails-0.1.0.gem | |
Pushing gem to https://rubygems.org... | |
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> | |
<html><head> | |
<title>500 Internal Server Error</title> | |
</head><body> | |
<h1>Internal Server Error</h1> | |
<p>The server encountered an internal error or | |
misconfiguration and was unable to complete | |
your request.</p> |
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
Kimono = Ember.Application.create() | |
window.Kimono = Kimono | |
header = Ember.View.create | |
logoUri: "<%= image_path('kimono-vsmall-notext.png') %>" | |
templateName: 'views_header' | |
isVisible: false | |
elementId: 'header' | |
header.appendTo('#layout') |
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
~$ cd HelloWorld | |
~/HelloWorld$ echo "gem 'emberjs-rails'" >> Gemfile | |
~/HelloWorld$ bundle | |
Fetching source index for http://rubygems.org/ | |
Using rake (0.9.2.2) | |
Using multi_json (1.0.4) | |
Using activesupport (3.1.3) | |
Using builder (3.0.0) | |
Using i18n (0.6.0) |
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
shared_examples_for "a Faye server" do | |
self.use_transactional_fixtures = false | |
it "should have Event Machine reactor running" do | |
EM.reactor_running?.should be_true | |
end # Passes. | |
it "should be able to subscribe to channel" do | |
channel = "/random/#{rand(65534).to_s}" | |
message = "Successful subscription." |
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
def handle_request(request) | |
json_msg = message_from_request(request) | |
message = JSON.parse(json_msg) | |
jsonp = request.params['jsonp'] || JSONP_CALLBACK | |
headers = request.get? ? TYPE_SCRIPT.dup : TYPE_JSON.dup | |
origin = request.env['HTTP_ORIGIN'] | |
debug 'Received ?: ?', request.env['REQUEST_METHOD'], json_msg | |
@server.flush_connection(message) if request.get? | |
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 TokenExtension | |
def incoming(m,c) | |
if m['channel'] == '/service/requestToken' | |
token = if m['ext'] && m['ext']['token'] | |
Token.find_by_token(m['ext']['token']) | |
elsif by_client = Token.find_by_client_id(m['clientId']) | |
by_client | |
else | |
Token.new.tap { |t| t.client_id = m['clientId'] } | |
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
1.9.3-p0 :002 > Crimson::Parser.parse('nil') | |
Exception: Parse error: Expected one of -, 0, nil at line 1, column 4 (byte 4) after . | |
from /Users/jnh/Dev/Toys/CrimsonScript/lib/crimson/parser.rb:12:in `parse' | |
from (irb):2 | |
from /Users/jnh/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<main>' | |
1.9.3-p0 :003 > Crimson::Parser.parse('0') | |
Exception: Parse error: Expected one of -, 0, nil at line 1, column 2 (byte 2) after . | |
from /Users/jnh/Dev/Toys/CrimsonScript/lib/crimson/parser.rb:12:in `parse' | |
from (irb):3 | |
from /Users/jnh/.rvm/rubies/ruby-1.9.3-p0/bin/irb:16:in `<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
" Function which runs a command using ConqueTerm in the | |
" current or split buffer. | |
" If no command is given it just runs bash. | |
function! RunCommandInBuffer(where,...) | |
" Can split the buffer if you want. | |
if a:where == 'new' | |
exec ':new' | |
elseif a:where == 'vnew' | |
exec ':vnew' | |
end |