Skip to content

Instantly share code, notes, and snippets.

View blahutka's full-sized avatar

blahutka blahutka

View GitHub Profile
gem 'acts_as_tree'
gem "simple_form"
gem 'inherited_resources', '1.1.2'
gem 'has_scope'
gem 'compass', :group => :development
gem 'devise'
if yes?('Add gem rails_admin?')
gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
end
@blahutka
blahutka / button_form.css
Created March 18, 2011 16:24
form and button
/**** B U T O N S ****/
/* sliding doors */
/* HTML SAMPLE
<a href="#" class="btn-orange-big"><span><span>Sign Up</span></span></a>
<button type="submit" class="FRM_button btn-orange"><span><span>Register</span></span></button>
*/
$button-background-color:#FFAE00;
$button-height: 46px;
@import "compass/utilities";
@import "compass/css3";
body {background-color:#7A7B82;}
.rounded-border {
background-color: white;
border: 1px solid #9A9A9A;
@include border-radius(5px, 5px);
}
.round-gray {
@blahutka
blahutka / iframe-widget.js
Created June 15, 2011 07:00
iframe widget
var demo = {
update: function() {
$('#demo-widget').remove();
var serialized = $(':radio, input, #id_single_occupation').serialize();
var multiselected = $('#id_selected_occupations option:selected').map(function () {
return $(this).val();
}).get().join(',');
serialized += '&selected_occupations=' + multiselected;
var iframe = $('<iframe id="demo-widget" src="/widget/demo/?' + serialized + '#' + encodeURIComponent(document.location.href) +'" scrolling="no" frameborder="0"></iframe>');
iframe.appendTo('#widget-preview');
@blahutka
blahutka / Procfile
Created July 1, 2011 17:49
Procfile
# DON'T PUT THIS COMMENT IN THE Procfile
# FOR DEVELOPMENT
# Run from command line with: bundle exec rvmsudo foreman start
# ----------------------------------------------------------------
app: bundle exec unicorn -p 3000 -c config/unicorn.rb
web: /usr/sbin/nginx -g "daemon off;"
# FOR PRODUCTION
# export with:foreman export upstart /etc/init -c web=2 -c worker=4 -c clock=1
@blahutka
blahutka / sprinkle.rb
Created August 23, 2011 19:10
Vagrant - Sprinkle provisioner
module Vagrant
module Provisioners
class Sprinkle < Base
register :sprinkle
class Config < Vagrant::Config::Base
attr_accessor :cookbooks_path
end
def prepare
@blahutka
blahutka / rails31init.md
Created September 28, 2011 21:50 — forked from a-bash/rails31init.md
Rails 3.1 with Rspec, Cucumber, Factory Girl, Haml, and Simple Form

Install Rails 3.1 RC

gem install rails --pre

generate new app, skipping Test::Unit file generation

rails new my_app -T

Set up Gemfile

@blahutka
blahutka / en.yml
Created October 24, 2011 18:39 — forked from chrisbloom7/01-validates-file-size-carrierwave.md
A cheap knock off of the default validates_length_of validator, but checks the filesize of a Carrierwave attachment
# config/locales/en.yml
en:
errors:
messages:
wrong_size: "is the wrong size (should be %{file_size})"
size_too_small: "is too small (should be at least %{file_size})"
size_too_big: "is too big (should be at most %{file_size})"
@blahutka
blahutka / rvm_setup.sh
Created February 15, 2012 16:25
RVM, git, sqlite, openssl
# Install RVM and dependencies
sudo aptitude install curl git-core
sudo bash -c "bash <( curl -L https://github.com/wayneeseguin/rvm/raw/1.3.0/contrib/install-system-wide ) --version '1.3.0'"
sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev
sudo adduser `whoami` rvm
echo 'source /usr/local/lib/rvm' >> ~/.bashrc
# Set up users and groups
sudo useradd --home /var/www --create-home --groups rvm nginx && sudo chmod g+w /var/www
sudo adduser `whoami` nginx
#