Skip to content

Instantly share code, notes, and snippets.

View Tho85's full-sized avatar
🚀

Thomas Hollstegge Tho85

🚀
View GitHub Profile
require 'json'
require 'json/generic_object'
JSON.parse '{"json_class":"JSON::GenericObject", "foo":"bar"}'
# => #<JSON::GenericObject foo="bar">
var Markdown;
if (typeof exports === "object" && typeof require === "function") // we're in a CommonJS (e.g. Node.js) module
Markdown = exports;
else
Markdown = {};
// The following text is included for historical reasons, but should
// be taken with a pinch of salt; it's not all true anymore.
@Tho85
Tho85 / Gemfile
Created May 20, 2011 08:40
libvncclient-ruby-test
gem 'libvncclient-ruby', :require => 'libvnc', :git => 'git@github.com:zweitag/libvncclient-ruby.git'
require "set"
def all_chars_in_file(file)
all_chars = Set.new
File.open(file).each_line do |line|
line.chars.inject(all_chars) { |s,c| s << c }
end
all_chars
end