Skip to content

Instantly share code, notes, and snippets.

View icebreaker's full-sized avatar
👽
Code gardening!

Mihail Szabolcs icebreaker

👽
Code gardening!
View GitHub Profile
@icebreaker
icebreaker / coderwall.rb
Created June 6, 2011 13:59 — forked from vivien/coderwall.rb
Simple and Stupid Ruby API for Coderwall.com
# Simple and Stupid Ruby API for Coderwall.com
# Vivien Didelot <vivien@didelot.org>
require "open-uri"
require "json"
module CoderWall
class Achievement
attr_reader :name, :badge, :description
@icebreaker
icebreaker / coderwall.js
Created June 6, 2011 13:58
Coderwall Badge Script for Blogs (or any other Web Page)
/*
*
* coderwall.js
*
* Code to display coderwall.com badges
*
*/
var coderwallJSONurl ="http://www.coderwall.com/hermanjunge.json?callback=?";
var height = 75;
match = request.env['REQUEST_URI'].match(/(\/.*)/)
if match
redirect "http://www.#{host}#{match[1]}",301
else
redirect "http://www.#{host}/",301
end
@icebreaker
icebreaker / t_extractor.rb
Created May 11, 2011 13:42
Basic t(...) extractor
#!/usr/bin/env ruby
if ARGV.size < 1
puts "usage: t_extrator dir"
exit(1)
end
Dir.glob("#{ARGV[0]}/**/*").each do |file|
if FileTest.file? file
c = File.read(file)
@icebreaker
icebreaker / forwarder.py
Created March 25, 2011 15:36
Port forwarder
# original source: http://code.activestate.com/recipes/483732-asynchronous-port-forwarding/
import socket
import asyncore
class forwarder(asyncore.dispatcher):
def __init__(self, ip, port, remoteip,remoteport,backlog=5):
asyncore.dispatcher.__init__(self)
self.remoteip=remoteip
self.remoteport=remoteport
@icebreaker
icebreaker / mongoid-cheatsheet.md
Created February 15, 2011 09:11
Mongoid cheat sheet
@icebreaker
icebreaker / santa.md
Created December 24, 2010 12:23
Santa Claus is coming To Geek Town

Santa Claus is Coming To Geek Town

better !pout !cry
better watchout
lpr why
santa claus town

cat /etc/passwd >list
ncheck list
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests
@icebreaker
icebreaker / test_runner.rb
Created November 2, 2010 11:29
Run a single test from a test suite.
#!/usr/bin/ruby
require 'tempfile'
if ARGV.size < 3
# Example test_runner unit post "can delete"
puts "usage: test_runner [type=unit,functional,integration] [testname] [testmethod]"
exit
end
class TestRunner
--[[
Simple Class Implementation for Lua using Metetables.
This is very clean and simple, sticking to some very
simple principles.
Static methods defined with . (dot) and instance methods
with : (semicolon) .
Default values declared when defining the initial table.
The .new static method implements the constructor which