Skip to content

Instantly share code, notes, and snippets.

View SpencerCooley's full-sized avatar

Spencer Cooley SpencerCooley

View GitHub Profile
cd projects/my_app
git commit -m 'this is my first commit. you can write any message here'
git remote add origin [email protected]:SpencerCooley/my_app.git
git push origin master
git add .
git commit -m 'I just made some changes to my app blah blah'
git push origin master
<% if notice %>
<div id="notice"><%= notice %></div>
<% end %>
@SpencerCooley
SpencerCooley / gist:1071293
Created July 8, 2011 07:11
User model code.
class User < ActiveRecord::Base
attr_accessor :password
attr_accessible :email, :password, :password_confirmation
email_regex = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :password,
:confirmation => true,
:length => {:within=>6..20},
:presence=>true
@SpencerCooley
SpencerCooley / gist:1189542
Created September 2, 2011 19:08
how to open html file from the terminal
$ x-www-browser "filename.html"
<head>
<title>WildCard</title>
<link href="/assets/application.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/people.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<link href="/assets/scaffolds.css?body=1" media="screen" rel="stylesheet" type="text/css" />
<script src="/assets/jquery.js?body=1" type="text/javascript"></script>
<script src="/assets/jquery_ujs.js?body=1" type="text/javascript"></script>
<script src="/assets/people.js?body=1" type="text/javascript"></script>
<script src="/assets/application.js?body=1" type="text/javascript"></script>
<meta content="authenticity_token" name="csrf-param" />