Skip to content

Instantly share code, notes, and snippets.

View Thorsson's full-sized avatar
🎯
Focusing

Ivan Turkovic Thorsson

🎯
Focusing
View GitHub Profile
@jbr
jbr / dj_monit_runner.sh
Created July 7, 2009 06:13
Delayed::Job runner for monit
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
APP_NAME=your_app_name_here #<--fill this in
APP_DIR=/var/www/apps/
RAILS_ROOT=$APP_DIR/current
if [ "$3" ]; then
RUNNER="$3"
else
RUNNER=1
@jnunemaker
jnunemaker / gist:217362
Created October 24, 2009 04:07 — forked from lukesutton/gist:107966
example of warden with sinatra
Warden::Manager.serialize_into_session{|user| user.id }
Warden::Manager.serialize_from_session{|id| User.get(id) }
Warden::Manager.before_failure do |env,opts|
# Sinatra is very sensitive to the request method
# since authentication could fail on any type of method, we need
# to set it for the failure app so it is routed to the correct block
env['REQUEST_METHOD'] = "POST"
end
@juliamae
juliamae / gist:753311
Created December 23, 2010 18:01 — forked from luke0x/gist:115795
Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger
Deploying a Rails 3 App with EC2 + S3 + Ubuntu + Capistrano + Passenger
=======================================================================
EC2 Setup
---------
1 Launch New ec2 instance - ami-1634de7f
2 Create elastic IP [ELASTIC_IP] and associate it with instance
3 go to domain registrar DNS settings, @ and www to ELASTIC_IP
4 set the `:host` in `config/deploy.rb` to ELASTIC_IP
@simeonwillbanks
simeonwillbanks / Gemfile
Created January 26, 2012 23:18
#gemfile rails 3, rspec-rails, capybara, capybara-webkit, headless in order to run request specs that can test javascript
source 'https://rubygems.org'
gem 'rails', '3.2.0'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@lamikae
lamikae / jhw-assets.md
Created February 5, 2012 12:28
Jasmine headless testing on Rails 3 asset pipeline

Jasmine headless testing on Rails 3 asset pipeline

  • assets and specs can be CoffeeScript
  • 3rd party JS can be placed to vendor/assets/javascripts or vendor gems
  • detects gem-vendored JS via application.js require
  • uses jasmine-headless-webkit to run the suite outside the browser
    • this requires Qt4.7 installation
@canimus
canimus / paymill_form.coffee
Last active December 19, 2015 08:59
Paymill Form
window.onload = ->
# Development
window.PAYMILL_PUBLIC_KEY = 'PUBLIC_TEST_KEY'
# Production
PaymillErrorHandler = (error_message) ->
# Add elements to container if don't exist
s = $('.container').children('#notification').size()
@ik5
ik5 / daemon.rb
Created June 22, 2010 18:43
a quick and dirty jruby daemon based on basic_daemon
#!/usr/bin/env jruby
#
#
require 'rubygems'
require 'spoon'
EXEC = '/tmp/exec.rb'
PID_PATH = '/tmp/exec.pid'
WORK_PATH = '/tmp/'
@eric1234
eric1234 / 0_instructions.txt
Created April 9, 2011 01:12
Using Sprockets 2 in Rails 3.0.x with CoffeeScript & SASS
UPDATE: Please see some of the forks for an updated version of this guide. I
myself have moved onto the Rails 3.1 betas to get the asset pipeline. But if
you want to stay on stable there are other folks who are keeping this guide
relevant despite the changes constantly occurring on Sprockets 2. The comments
on this gist will lead you to the right forks. :)
Some brief instructions on how to use Sprocket 2 in Rails to get CoffeeScript
powered JS and SASS powered CSS with YUI compression all via the magic of rack.
This stuff will be native in Rails 3.1 and the layout of the files on the
@ryanb
ryanb / rails_3_1_rc4_changes.md
Created May 6, 2011 01:10
The Changelogs for Rails 3.1 Beta 1

Railties 3.1 RC4

  • The new rake task assets:clean removes precompiled assets. [fxn]

  • Application and plugin generation run bundle install unless --skip-gemfile or --skip-bundle. [fxn]

  • Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]

  • Template generation for jdbcpostgresql #jruby [Vishnu Atrai]

@romansklenar
romansklenar / REAME.md
Last active February 19, 2020 14:14
How to set up your VPS with Chef Solo

How to set up your VPS with Chef Solo

1. What is it?

There are many different provisioning tools out there, the most popular of which are Chef and Puppet. Chef uses Ruby, Puppet uses a DSL (Domain Specific Language), there are others that use simple bash too, but today we're going to focus on Chef Solo.

2. Dependencies

To get Chef working properly on your local machine you need a few things.

Make sure you use Ruby 1.9.x and not Ruby 2.x as you will get errors with the json 1.6.1 gem on 2.x. Use rbenv or RVM to manage several different Rubies on the one machine.