Skip to content

Instantly share code, notes, and snippets.

View 5v3n's full-sized avatar

Sven Kräuter 5v3n

View GitHub Profile
require 'rubygems'
require 'nokogiri'
require 'open-uri'
require 'digest/md5'
require 'csv'
require 'json'
require 'curb'
require 'pp'
data = []
http://www.ixquick.com/do/metasearch.pl?&cat=web&query=
<%#
# search given tags...
%>
<%
require File.join(File.dirname(__FILE__), 'src', 'toto_decoration')
decorator = TotoDecoration.new
%>
@5v3n
5v3n / gc_test.rb
Created October 4, 2010 19:48 — forked from mattetti/gc_test.rb
# hacking some lines to get into the ruby object allocation process...
# Enable the GC profiler:
GC::Profiler.enable
# If our test create too many objects forcing the GC to run,
# we can disable the GC to properly see the object allocation
# GC.disable
def count_string_allocations
sys = require 'sys'
#oo love:
class MyMath
square: (x) ->
x * x
cube: (x) ->
this.square(x) * x
#functional love:
printSquare = (number_to_process) ->
"square(#{number_to_process}) = #{myMath.square(number_to_process)}" #<- why does this work? myMath should be out of scope in here!
sys = require 'sys'
class MyMath
square: (x) ->
x * x
cube: (x) ->
this.square(x) * x
#let's get something rolling:
myMath = new MyMath
x = 3
#mind the nice string processing:
var MyMath, myMath, sys, x;
sys = require('sys');
MyMath = function() {};
MyMath.prototype.square = function(x) {
return x * x;
};
MyMath.prototype.cube = function(x) {
return this.square(x) * x;
};
myMath = new MyMath();
@5v3n
5v3n / .rvmrc
Created November 7, 2010 10:28
Gemfile & .rvmrc for schacon/showoff
rvm ree@showoff
@5v3n
5v3n / .vimrc
Created November 16, 2010 19:08
basic .vimrc
if has("autocmd")
filetype plugin indent on
endif
set sw=2
set sts=2
set background=dark
set cindent
set smartindent
set autoindent
set expandtab
require 'rubygems'
require 'fileutils'
require 'pathname'
require 'ruby-debug'
require 'ostruct'
require 'rest_client'
require 'json'
# multiple gems use the require tumblr, this one refers to http://github.com/mwunsch/tumblr
# note that ruby-debug and the weary lib, which makes reqs for this tumblr gem, don't play nicely together