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
//Tower of Hanoi
//No of calls made for n disks is equal to pow(2,n) -1.
void hanoi(int n, char a, char c, char b)
{
if(n==1)
{
printf("\nShift disk 1 from %c to %c",a,c);
return ;
}
@icebreaker
icebreaker / think.markdown
Created March 12, 2009 12:24 — forked from csexton/think.markdown
Note to self.

Note to Self

Be Confident

Tests build confidence. Write 'em. They'll save your ass, and they'll let you take a chainsaw to your code without being afraid of unintended consequences.

Be Lazy

:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
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 / 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;
@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 <[email protected]>
require "open-uri"
require "json"
module CoderWall
class Achievement
attr_reader :name, :badge, :description
# rubygems DNS is temporarily down, if you're using ghost to manage local DNS
# munging, run the following:
ghost add rubygems.org 72.4.120.124
ghost add production.s3.rubygems.org 207.171.181.231
ghost add production.cf.rubygems.org 216.137.45.24
# Don't forget to clear them out afterwards with:
# ghost delete_matching rubygems.org
@icebreaker
icebreaker / qt-support.lua
Created December 17, 2011 10:47 — forked from annulen/qt-support.lua
Support for Qt Framework for Premake
--
-- qt-support.lua
-- Support for Qt Framework for Premake
-- Copyright (c) 2011 Konstantin Tokarev
--
-- Known limitations:
-- don't support static Qt builds yet (private links, lib order, plugins)
-- no support for Qt debug libs (Mac, Win)
-- only gmake
-- no Windows support yet
@icebreaker
icebreaker / tiny_git_webserver.py
Created August 11, 2012 08:02 — forked from williame/tiny_git_webserver.py
A super-simple web-server to serve up files in a git (bare) repo
import os, subprocess, base64
import tornado.ioloop
import tornado.web
from tornado.options import define, options, parse_command_line
define("port",default=8888,type=int)
define("branch",default="master")
define("access",type=str,multiple=True)
class MainHandler(tornado.web.RequestHandler):