Skip to content

Instantly share code, notes, and snippets.

# Allows you to build a Hash in a fashion very similar to Builder. Example:
#
# HashBuilder.build! do |h|
# h.name "Brent"
# h.skillz true
# h.location do
# h.planet "Earth"
# end
# end
#
@ess
ess / myfs.rb
Created September 17, 2011 17:59 — forked from sneakin/myfs.rb
A super basic RFuse file system.
#!/usr/bin/env ruby
#
# Minus the logging, this is the simplest file system that's most likely
# possible with RFuse-NG. It presents a single directory level that stores
# the contents of files in a Hash.
#
# This is in the public domain.
#
# Enjoy,
# sneakin

Using bitlbee with HipChat

Initial setup

  • account add jabber [email protected] 'PASSWORD'
  • account hipchat set nick_source full_name
  • account hipchat set resource bot
  • account hipchat on
require "capybara"
# Encapsulate some jQuery UI interactions so we can call them cleanly using Capybara.
module Capybara::JQueryUI
# Find the jQuery UI Autocomplete widget corresponding to this element
def autocompleter
jquery_result(jquery_this(".autocomplete('widget')").first)
end
# Fill in an autocompletable field and accept a completion.
@ess
ess / hw22-3
Last active December 11, 2017 23:48 — forked from wisetara/hw22-3
Bash script
# Write a bash script named "hw22-3" that accepts a list of inode numbers from the command line,
# and displays
# the file name and physical file system of each file with that inode number. If no
# file exists with that inode number display "no such file".
#
# EXAMPLE:
# > hw22-3 8384567 12345
# Inode "8384567" has files:
# main.cpp on /dev/mapper/system-student
#