Skip to content

Instantly share code, notes, and snippets.

View bryanthompson's full-sized avatar

Bryan Thompson bryanthompson

  • http://www.37chairs.com
  • Lincoln, NE
View GitHub Profile

(a gist based on the old toolmantim article on setting up remote repos)

To collaborate in a distributed development process you’ll need to push code to remotely accessible repositories.

This is somewhat of a follow-up to the previous article setting up a new rails app with git.

For the impatient

Set up the new bare repo on the server:

@mudge
mudge / init.pp
Created May 5, 2011 16:35
Puppet class for a CentOS/RedHat server with RVM installed.
# rvm_server/manifests/init.pp
class rvm_server($version='latest') {
# Dependencies for RVM and Ruby.
package { 'rvm-dependencies':
ensure => installed,
name => ['bash', 'gawk', 'sed', 'grep', 'which', 'coreutils', 'tar',
'curl', 'gzip', 'bzip2', 'gcc-c++', 'autoconf', 'patch',
'readline', 'readline-devel', 'zlib', 'zlib-devel',
@febuiles
febuiles / god.rb
Created November 25, 2011 22:46
God config for Hubot
# start the service with `god -c /etc/god/god.conf`. Use `rvmsudo` if you
# manage your rubies with RVM.
# You can see the start/stop script for Hubot at: https://gist.github.com/1394520
God.watch do |w|
w.name = "hubot"
w.start = "/etc/init.d/hubot start"
w.stop = "/etc/init.d/hubot stop"
w.restart = "/etc/init.d/hubot restart"
@mattetti
mattetti / rack_example.ru
Created December 8, 2011 13:58
Very basic rack application showing how to use a router based on the uri and how to process requests based on the HTTP method used.
#########################################
# Very basic rack application showing how to use a router based on the uri
# and how to process requests based on the HTTP method used.
#
# Usage:
# $ rackup rack_example.ru
#
# $ curl -X POST -d 'title=retire&body=I should retire in a nice island' localhost:9292/ideas
# $ curl -X POST -d 'title=ask Satish for a gift&body=Find a way to get Satish to send me a gift' localhost:9292/ideas
# $ curl localhost:9292/ideas
@jjulian
jjulian / example.erb
Created February 18, 2012 16:44
Running Ruby under Apache like PHP, using cgi - http://stackoverflow.com/a/1901772/231245
<% header "Content-Type" => "text/html" %>
<h1>Let's run some ruby code: <%= rand %></h1>
class ActiveRecord::Base
attr_accessible nil
def update_attributes *args
raise "Don't call #{self.class.name}#update_attributes. " +
"Mass assignment is pure evil."
end
end
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active June 21, 2024 01:45
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/usr/bin/env bash
#
# Wraps curl with a custom-drawn progress bar. Use it just like curl:
#
# $ curl-progress -O http://example.com/file.tar.gz
# $ curl-progress http://example.com/file.tar.gz > file.tar.gz
#
# All arguments to the program are passed directly to curl. Define your
# custom progress bar in the `print_progress` function.
#
@brianknapp
brianknapp / immutable_entity.rb
Last active December 15, 2015 07:09
Obvious immutable entity with validation
module Obvious
module EntityMixin
class << self
def included(base)
base.extend ClassMethods
end
end