Skip to content

Instantly share code, notes, and snippets.

View Saicheg's full-sized avatar

Valentine Zavadsky Saicheg

  • Lisbon, Portugal
View GitHub Profile
#!/bin/bash
# Checks the files to be committed for the presence of binding.pry
# The array below can be extended for further checks
checks[1]="binding.pry"
checks[2]="console.log"
element_count=${#checks[@]}
let "element_count = $element_count + 1"
#!/usr/bin/env ruby
require 'rubygems'
gempaths = Gem::default_path
puts
puts "Scanning paths in Gem::default_path for RubyGems with native extensions ..."
puts
# A small DSL for helping parsing documents using Nokogiri::XML::Reader. The
# XML Reader is a good way to move a cursor through a (large) XML document fast,
# but is not as cumbersome as writing a full SAX document handler. Read about
# it here: http://nokogiri.org/Nokogiri/XML/Reader.html
#
# Just pass the reader in this parser and specificy the nodes that you are interested
# in in a block. You can just parse every node or only look inside certain nodes.
#
# A small example:
#