Skip to content

Instantly share code, notes, and snippets.

#! /bin/bash
### BEGIN INIT INFO
# Provides: gitlab
# Required-Start: $local_fs $remote_fs $network $syslog redis-server
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: GitLab git repository management
# Description: GitLab git repository management
### END INIT INFO
@hbdev012
hbdev012 / readline.md
Created June 23, 2012 08:17
How to resolve readline error without recompiling ruby(rvm)

Install this gem

gem install rb-readline

And add the following line to your Gemfile:

# Gemfile
gem 'rb-readline'
@hbdev012
hbdev012 / bdd.txt
Created June 19, 2012 08:43
BDD and TDD ref.
http://www.lukeredpath.co.uk/blog/developing-a-rails-model-using-bdd-and-rspec-part-1.html
http://www.typeoneerror.com/articles/post/tutorial-rails-with-rspec-spork-and-guard-from-scratch
http://pure-rspec-rubynation.heroku.com/
http://www.rubyinside.com/how-to-rails-3-and-rspec-2-4336.html
https://github.com/felipecsl/saasquatch.git
http://www.jasongrimes.org/2011/06/free-clouds-setting-up-wordpress-on-a-free-amazon-ec2-instance/
@hbdev012
hbdev012 / gist:2469117
Created April 23, 2012 06:24
Gem installation Error
Fetching: bundler-1.1.3.gem ( 18%)ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
too many connection resets (http://cachefly.mirrors.rubygems.org/gems/bundler-1.1.3.gem)
@hbdev012
hbdev012 / gist:2437002
Created April 21, 2012 13:04
Rubygems update : Security Declaration
== 1.8.23 / 2012-04-19
This release increases the security used when RubyGems is talking to
an https server. If you use a custom RubyGems server over SSL, this
release will cause RubyGems to no longer connect unless your SSL cert
is globally valid.
You can configure SSL certificate usage in RubyGems through the
:ssl_ca_cert and :ssl_verify_mode options in ~/.gemrc and /etc/gemrc.
The recommended way is to set :ssl_ca_cert to the CA certificate for
@hbdev012
hbdev012 / gist:1955955
Created March 2, 2012 05:41
assume method usage
class UserController
before_filter :current_user
def profile
# here you can access current_user object returned by before_filter
end
private
@hbdev012
hbdev012 / web_socket_server.rb
Created March 1, 2012 12:35
A simple websocket server using em-websockets
require 'rubygems'
require 'em-websockets'
EventMachine.run {
EventMachine::WebSocket.start(:host => "0.0.0.0", :port => 8080) do |ws|
ws.onopen {
puts "WebSocket connection open"
# publish message to the client