Skip to content

Instantly share code, notes, and snippets.

View kukula's full-sized avatar
🇺🇦

Tolik kukula

🇺🇦
View GitHub Profile

Pry Cheat Sheet

Command Line

  • pry -r ./config/app_init_file.rb - load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb - load your rails into a pry session

Debugger

@kukula
kukula / pr.md
Last active August 29, 2015 14:24 — forked from tregusti/pr.md

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	url = git@github.com:joyent/node.git
	fetch = +refs/heads/*:refs/remotes/origin/*

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

# USAGE: Hash.from_xml:(YOUR_XML_STRING)
require 'nokogiri'
# modified from http://stackoverflow.com/questions/1230741/convert-a-nokogiri-document-to-a-ruby-hash/1231297#1231297
class Hash
class << self
def from_xml(xml_io)
begin
result = Nokogiri::XML(xml_io)
return { result.root.name.to_sym => xml_node_to_hash(result.root)}