Skip to content

Instantly share code, notes, and snippets.

View jayroh's full-sized avatar
😎

Joel Oliveira jayroh

😎
View GitHub Profile
@jayroh
jayroh / gist:186191
Created September 13, 2009 13:41 — forked from pat/gist:181369
We couldn’t find that file to show.
$ cd nextbus/
$ git init
$ vim .gitignore
# add files to be ignored
$ git add .
$ git commit -m 'Initial commit'
# setup github repo, adding collaborator(s)
$ git remote add origin git@github.com:neweryankee/nextbus.git
$ git push origin master
$ vim Rakefile
source 'http://rubygems.org'
gem 'rails', '3.0.0.beta3'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'pg', '0.8.0'
gem 'inherited_resources', '1.1.2'
/*
* * JavaScript Pretty Date
* * Copyright (c) 2008 John Resig (jquery.com)
* * Licensed under the MIT license.
* */
// Takes an ISO time and returns a string representing how
// long ago the date represents.
@jayroh
jayroh / _boilerplate.scss
Created January 23, 2011 17:38
customized html5boilerplate css in the form of an scss partial
// when selecting text, use the following bg and fg colors
$selection-background: #8d7c79;
$selection-color: #4c3332;
html, body, div, span, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
abbr, address, cite, code,
del, dfn, em, img, ins, kbd, q, samp,
small, strong, sub, sup, var,
b, i,
# CANONICAL ROBOTS.TXT
<IfModule mod_rewrite.c>
RewriteBase /
RewriteCond %{REQUEST_URI} !^/robots.txt$ [NC]
RewriteCond %{REQUEST_URI} robots\.txt [NC]
RewriteRule .* http://examplesite.com/robots.txt [R=301,L]
</IfModule>
# CANONICAL FAVICONS
@jayroh
jayroh / stack trace
Created June 18, 2011 02:37
installed gems
*** LOCAL GEMS ***
activemodel (3.0.9)
activerecord (3.0.9)
activesupport (3.0.9)
acts_as_list (0.1.3)
arel (2.0.10)
builder (2.1.2)
bundler (1.0.15)
cgi_multipart_eof_fix (2.5.0)
/* scss */
#nav {
li a {
color: maroon;
body.admin & { border-bottom: dotted 1px maroon; } // <-- Awesome-sauce right there
&:hover {
color: purple;
}
@jayroh
jayroh / gist:3989630
Created October 31, 2012 20:30
small refactor
class Dashboards::MessagesController < ApplicationController
include DashboardsHelper
include ApplicationHelper
layout 'dashboard'
before_filter :user_must_be_signed_in
before_filter :must_be_approved_or_incomplete_if_coach
before_filter :set_whether_coach_client
def create
@coach = Coach.find(params[:message].delete(:coach))
#!/usr/bin/env ruby
require "fitgem"
require "pp"
require "yaml"
config_file = begin
File.open(".fitgem.yml")
rescue Object => e
puts 'No .fitgem.yml config file found'