Skip to content

Instantly share code, notes, and snippets.

@infoslack
infoslack / Dockerfile
Created October 8, 2014 05:26
Demo Docker on Rails
FROM ubuntu:trusty
# Update the repository
RUN apt-get update
# Install necessary tools
RUN apt-get install -y wget net-tools build-essential git
# Setup Install Nginx
RUN wget -q -O - http://nginx.org/keys/nginx_signing.key | apt-key add -
@sergiosvieira
sergiosvieira / fluxo-trabalho-git.md
Last active January 31, 2024 01:13
Fluxo de Trabalho Utilizando Git para Pequenas Equipes

Fluxo de Trabalho do Git para Pequenas Equipes

  1. Primeiro, crie um branch de desenvolvimento no seu repositório local:
$ git checkout --track origin/development
  1. Trabalhe em sua tarefa normalmente. Lembre-se de fazer commits frequentes para manter o rastro do seu progresso.
@dchud
dchud / dspace-4.0-bin-install-guide
Last active August 29, 2015 13:56
20-minute guide to installing DSpace-4.0 from binary release on Ubuntu 12.04 LTS
# dchud's 20 minute guide to installing DSpace 4.0 from the binary release
# on a clean ubuntu 12.04 server running on aws ec2 or where-have-you
#
# this guide assumes you are already comfortable with *nix system administration
#
# this guide leaves out anything to do with the many details of configuring
# DSpace itself; it just gets you to the "it's up and running" step
#
# to start: get your clean ubuntu-12.04 system up to date
$ sudo apt-get update && sudo apt-get upgrade
@ariera
ariera / README.markdown
Created August 7, 2011 16:23
Nestable, sortable and dragable categories

Nestable, sortable and dragable categories:

In the project I'm working on we wanted to have a Category model which we wanted to be nestable. But we also liked the user to have a draggable interface to manage and rearrange the order of his categories. So we chose awesome_nested_set for the model and jQuery.nestedSortable for the UI.

It took me some time to arrange things to work properly so I wanted to share my work in case it helps anybody.

Before beginning

you might want to take a look at a demo app

  1. go to: http://awesomenestedsortable.heroku.com/groups/
  2. click in show of any group
@lucascaton
lucascaton / resque.rb
Created July 8, 2011 03:10
resque.rake
require 'resque/tasks'
require 'active_record'
env = ENV["RAILS_ENV"] || 'development'
database_config = YAML::load(File.open('config/database.yml'))
connection = ActiveRecord::Base.establish_connection(database_config[env])
files = ['lib/foo', 'lib/bar', 'app/models/foo', 'app/workers/foo']
files.each { |file| require file }
@adimircolen
adimircolen / customer.rb
Created May 6, 2011 20:16
validates_associated
class Customer < ActiveRecord::Base
has_many :projects
validates :name, :presence => true
validates :cnpj, :presence => true, :format => { :with => /^\d{2}.?(\d{3}.?){2}\/\d{4}-?\d{2}$/ }
end
describe "GET current" do
before do
@request.cookies['hidden_notices'] = "1,#{notices(:permanent).id}"
get :current, :format => 'js'
end
it { should respond_with(:success) }
it { should set_cookie(:hidden_notices).to("#{notices(:permanent).id}") }
it { should render_template('notices/current') }
end
@dnagir
dnagir / rspec-syntax-cheat-sheet.rb
Created November 5, 2010 09:29
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")