Skip to content

Instantly share code, notes, and snippets.

@garethrees
garethrees / hilong.rb
Created March 31, 2018 20:57 — forked from jstorimer/hilong.rb
hilong -- A simply utility to show character counts for each line of input and highlight lines longer than 80 characters.
#!/usr/bin/env ruby
# A simply utility to show character counts for each line of input and
# highlight lines longer than 80 characters.
#
# Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html
#
# Examples:
#
# $ hilong Gemfile
@garethrees
garethrees / packages.md
Created March 26, 2013 11:55 — forked from Odaeus/packages.md
Packages required for installing Ruby on CentOS 6

Minimal for gem compilation

  • build-essential

Common for gems

  • libxml2
  • libxml2-dev (for nokogiri)

Ruby compilation

  • libreadline6
@garethrees
garethrees / hack.sh
Last active December 30, 2018 18:49 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2470157/hack.sh | sh
#
@garethrees
garethrees / gfm.rb
Created March 28, 2012 23:33 — forked from mojombo/gfm.rb
Github Flavoured Markdown
require 'digest/md5'
def gfm(text)
# Extract pre blocks
extractions = {}
text.gsub!(%r{<pre>.*?</pre>}m) do |match|
md5 = Digest::MD5.hexdigest(match)
extractions[md5] = match
"{gfm-extraction-#{md5}}"
end