Skip to content

Instantly share code, notes, and snippets.

@tyrotinal
tyrotinal / bootstrap 2.3.2 cdn
Created August 29, 2013 19:48
bootstrap 2.3.2 cdn
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.3.2/css/bootstrap-combined.min.css" rel="stylesheet">
@tyrotinal
tyrotinal / jquery cdn
Created August 21, 2013 23:13
jquery cdn 1.10.2
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
@tyrotinal
tyrotinal / gist:5751384
Created June 10, 2013 19:13
rails: favicon link
<link rel="icon" type="image/png" href="<%= asset_path 'favicon.png' %>">
@tyrotinal
tyrotinal / gist:5694189
Created June 2, 2013 17:14
rails: routing define path
get '/admin', to: 'admin_users#index', as: :admin_user
@tyrotinal
tyrotinal / gist:5692552
Created June 2, 2013 03:39
mysql: update statement
UPDATE Persons SET Age=36 WHERE FirstName='Peter' AND LastName='Griffin'
@tyrotinal
tyrotinal / gist:5683457
Created May 31, 2013 07:43
latex: make pdf
pdflatex -output-directory=./_ paper3.tex
@tyrotinal
tyrotinal / gist:5660748
Created May 28, 2013 06:03
mysql: grant privileges
grant all privileges on database_name.* to 'user_name'@'localhost' identified by 'password';
@tyrotinal
tyrotinal / gist:5660738
Created May 28, 2013 05:59
git: git aliases
[alias]
s = status
co = checkout
b = branch
cm = commit -m
a = add --all
p = push origin
pu = pull origin
l = log --oneline
@tyrotinal
tyrotinal / gist:5659902
Created May 28, 2013 01:06
rails initial rails gems rspec scratch
group :test, :development do
gem 'turn' #pretty print
gem 'rspec-rails'
gem 'capybara' #simulates user
gem 'guard-rspec' #running all the time
gem 'growl_notify' #notify mac
end
@tyrotinal
tyrotinal / gist:5649784
Created May 25, 2013 16:53
ruby: simple gpa calculator
#Grade QP Grade QP Grade QP Grade QP Grade QP
#A 4.0 B+ 3.3 B- 2.7 C 2.0 D 1.0
#A- 3.7 B 3.0 C+ 2.3 C- 1.7 F 0.0
# 3.7 < x <= 4.0 : A
# 3.3 < x <= 3.7 : A-
# 3.0 < x <= 3.3 : B+
# 2.7 < x <= 3.0 : B
# 2.3 < x <= 2.7 : B-
# 2.0 < x <= 2.3 : C+
# 1.7 < x <= 2.0 : C