Skip to content

Instantly share code, notes, and snippets.

@karottenreibe
karottenreibe / before.rb
Created November 20, 2012 13:53
An example of old ruby-gtk code
@hbox = Gtk::HBox.new(true, 0)
self.add(@hbox)
@vbox = Gtk::VBox.new(false, 0)
@hbox.pack_start(@vbox, true, true, WIDGET_SPACING)
@image = Gtk::DrawingArea.new
@vbox.pack_start(@image, true, true, WIDGET_SPACING)
@code_text = Gtk::TextView.new
@karottenreibe
karottenreibe / with_gtkbuilder.rb
Created November 20, 2012 13:48
Builder::Gtk example
require 'gtkbuilder'
Gtk.init
window = Builder::Gtk.new do |w|
w.vbox(true, 0) do |v|
v.start(true, true, 1) do
v.text_view do |t|
t.set_size_request(200, 200)
end
v.entry
@karottenreibe
karottenreibe / main.lua
Created October 30, 2012 19:34
Löve 2D Mandelbrot
threshold = 2
w = 800
h = 400
table = {}
function love.load()
for x=1,w,1 do
t = {}
@karottenreibe
karottenreibe / update_etc_hosts.sh
Created August 24, 2011 07:46
cron.daily script that updates my host file
#!/bin/sh
uri="http://someonewhocares.org/hosts/hosts"
dir=/etc
wget -q -O - "$uri" > $dir/hosts.pollock
if [ "$?" == "0" ]
then
echo "127.0.0.1 blocked.site.org" > $dir/hosts