Skip to content

Instantly share code, notes, and snippets.

View jraphael's full-sized avatar

Joel Jacinto jraphael

  • Altice
  • Porto, Portugal
  • 19:36 (UTC +01:00)
View GitHub Profile
@adamcooke
adamcooke / dsl.rb
Created November 7, 2014 15:20
The complete code from my DSL tutorial at http://blog.atechmedia.com/ruby-dsls-for-fun/
class AddressBook
def contacts
@contacts ||= []
end
def self.load_from_path(path)
# Create a new AddressBook instance
address_book = self.new
# Create a new AddressBookDSL instance
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 25, 2024 06:23
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

@simi
simi / Gemfile
Created February 7, 2012 14:32
Refinery + Twitter Bootstrap WIP
source 'https://rubygems.org'
gem 'rails', '3.2.1'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
@mattriley
mattriley / post_xml.rb
Created January 25, 2012 22:39
Ruby HTTP POST request containing XML content
require 'net/http'
def post_xml url_string, xml_string
uri = URI.parse url_string
request = Net::HTTP::Post.new uri.path
request.body = xml_string
request.content_type = 'text/xml'
response = Net::HTTP.new(uri.host, uri.port).start { |http| http.request request }
response.body
end
@seyhunak
seyhunak / simple_form.rb
Created December 14, 2011 23:17
Using simple_form and integrating Twitter Bootstrap
1. Use latest build
gem 'simple_form', :git => 'git://github.com/plataformatec/simple_form.git'
2. Create an initializer
# /config/initializers/simple_form.rb
# Use this setup block to configure all options available in SimpleForm.
SimpleForm.setup do |config|
# Wrappers are used by the form builder to generate a complete input.
# You can remove any component from the wrapper, change the order or even