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
if(location.pathname=="/"||location.pathname.match(/\/\d+\//))
{
var mc=document.getElementById("middleContent");
var img=mc.getElementsByTagName("img")[0];
var title=img.title;
img.removeAttribute("title");
var imgParent=img.parentNode;
var afterImg=img.nextSibling;
imgParent.insertBefore(document.createElement("br"),afterImg);
imgParent.insertBefore(document.createElement("br"),afterImg);
@icebreaker
icebreaker / TwentyThinks.markdown
Created May 7, 2010 09:57
Twenty things I give myself permission for.

Here are twenty things I give myself permission for:

  • I give myself permission to rest.
  • I give myself permission to laugh.
  • I give myself permission to play.
  • I give myself permission to make mistakes.
  • I give myself permission to say “no” to demands on my time that are simply draining.
  • I give myself permission to say “yes” to what I want.
  • I give myself permission to fulfill my lifelong dreams.
  • I give myself permission to ask for what I want.
@icebreaker
icebreaker / pricreator.rb
Created April 19, 2010 11:08
Scan and create a QT Creator project file which can be included in another project.
#!/usr/bin/env ruby
def ScanForFiles(sources, headers, pattern)
Dir[pattern].each do |f|
if FileTest.directory?(f)
ScanForFiles(sources, headers, "#{f}/*")
else
if f =~ /.h$/
headers.push(f)
else
#Newbie programmer
def factorial(x):
if x == 0:
return 1
else:
return x * factorial(x - 1)
print factorial(6)
#First year programmer, studied Pascal
require 'rubygems'
require 'sinatra'
set :public, Proc.new { File.join(root, '_site') }
# Basic Auth
use Rack::Auth::Basic do |username, password|
[username, password] == ['admin', 'admin']
end
require 'masquerade'
run Sinatra::Application
require 'rubygems'
require 'sequel'
require 'fileutils'
# NOTE: This converter requires Sequel and the MySQL gems.
# The MySQL gem can be difficult to install on OS X. Once you have MySQL
# installed, running the following commands should work:
# $ sudo gem install sequel
# $ sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

hello world

hello

@icebreaker
icebreaker / scoped_pointer_test.cpp
Created November 7, 2009 17:31
light-weight scoped pointer implementation
// Scoped Pointer
#include <stdio.h>
template<typename T>
class scoped_pointer
{
public:
scoped_pointer(T *pPointer=new T) : mPointer(pPointer) {}
virtual ~scoped_pointer()
{
:⌉
=⌉
¦-) as opposed to |
⍥ om nom nom