This file contains hidden or 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
source 'https://rubygems.org' | |
ruby '2.0.0' | |
gem 'jekyll' | |
gem 'maruku' | |
gem 'rake' | |
gem 'sass' | |
gem 'coffee-script' | |
gem 'guard-jekyll' |
This file contains hidden or 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 countdown | |
{ | |
local SECONDS=$1 | |
local START=$(date +%s) | |
local END=$((START + SECONDS)) | |
local CUR=$START | |
while [[ $CUR -lt $END ]] | |
do | |
CUR=$(date +%s) |
This file contains hidden or 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 DynamicHash < Hash | |
def []=(key, val) | |
super | |
self.class.class_eval do | |
define_method(key) do | |
self[key] | |
end | |
define_method("#{key}=") do |value| | |
self[key] = value | |
end |
This file contains hidden or 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
#!/usr/bin/env bash | |
sudo apt-get -y update | |
sudo apt-get --no-install-recommends -y install build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev libgdbm-dev ncurses-dev automake libtool bison pkg-config libffi-dev vim | |
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv | |
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build | |
cd |
This file contains hidden or 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
jQuery -> | |
Morris.Line | |
element: 'chart' | |
data: [ | |
{y: '2012', a: 100} | |
{y: '2011', a: 75} | |
{y: '2010', a: 50} | |
{y: '2009', a: 75} | |
{y: '2008', a: 50} | |
{y: '2007', a: 75} |
This file contains hidden or 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
gem 'raphael-rails' | |
gem 'morrisjs-rails' | |
gem 'gon' | |
#... |
This file contains hidden or 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 :db do | |
desc "Erase and fill database" | |
task :populate => :environment do | |
require 'populator' | |
#require 'faker' | |
[Category, Record].each(&:delete_all) | |
Category.populate 10 do |category| | |
category.title = Populator.words(2) |
This file contains hidden or 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
/* | |
... | |
*/ | |
@import "twitter/bootstrap/bootstrap"; | |
body{ padding-top: 60px; } | |
@import "twitter/bootstrap/responsive"; |
This file contains hidden or 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
<%= simple_form_for @record, :html => { :class => 'form-horizontal' } do |f| %> | |
<fieldset> | |
<legend><%= controller.action_name.capitalize %></legend> | |
<%= f.input :title %> | |
<%= f.input :amount %> | |
<%= f.association :category %> | |
<%= f.input :date %> | |
<div class="form-actions"> | |
<%= f.submit nil, :class => 'btn btn-primary' %> |
This file contains hidden or 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
<body> | |
<div class="container"> | |
<% flash.each do |name, msg| %> | |
<div class="alert alert-<%= name == :notice ? "success" : "error" %>"> | |
<a class="close" data-dismiss="alert">x</a> | |
<%= msg %> | |
</div> | |
<% end %> | |
</div> | |
<!-- Rest of content --> |