Skip to content

Instantly share code, notes, and snippets.

@grk
grk / main.c
Created February 7, 2011 09:55
~/Work/uni/padp/lists(master*) $ ./test
[==========] Running 5 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 5 tests from linked_list_test
[ RUN ] linked_list_test.is_empty_initially
[ OK ] linked_list_test.is_empty_initially (0 ms)
[ RUN ] linked_list_test.add_element
[ OK ] linked_list_test.add_element (0 ms)
[ RUN ] linked_list_test.add_exisiting_element
[ OK ] linked_list_test.add_exisiting_element (0 ms)
#ifndef __semaphore_t_h__
#define __semaphore_t_h__
#ifdef __APPLE__
#include <mach/mach_init.h>
#include <mach/task.h>
#include <mach/semaphore.h>
class semaph_t
require 'thread'
class ReadWriteLock
def initialize
@critical_section = Mutex.new
@are_writers_finished = ConditionVariable.new
@are_readers_finished = ConditionVariable.new
@readers = 0
@writers = 0
@writer_locked = false
@grk
grk / grapher.rb
Created March 24, 2009 22:18
Graphs with Sinatra and Scruffy
require 'rubygems'
require 'sinatra'
require 'scruffy'
require 'md5'
get '/' do
'This is Grapher.'
end
get '/graph/?' do
# config/deploy/shelly/before_restart
set -e
# link nested directory public/system to persistent disk/system
mkdir -p disk/public/images
ln -s ../disk/public/images public/images
➜ ~ heroku help | grep account
account # manage heroku account options
members # manage membership in organization accounts
orgs # manage organization accounts
➜ ~ heroku account
! `account` is not a heroku command.
! See `heroku help` for a list of available commands.
➜ ~ heroku help account
! account is not a heroku command. See `heroku help`.
➜ ~