Skip to content

Instantly share code, notes, and snippets.

View ghedo's full-sized avatar
:shipit:
🔥 This is fine 🔥

Alessandro Ghedini ghedo

:shipit:
🔥 This is fine 🔥
View GitHub Profile
@ghedo
ghedo / bpipe
Created March 10, 2012 14:59
Pipe stuff to the browser
#!/bin/sh -e
# Usage: bpipe [-h|--html]
# Pipe stuff to the browser
if [ -t 0 ]; then
echo "Usage: echo '<h1>some stuff</h1>' | bpipe"
else
opt=`getopt -o h --long html -n bpipe -- "$@"`
eval set -- "$opt"
@ghedo
ghedo / httpme
Created April 5, 2011 10:24
Serve static files from current working directory
#!/usr/bin/perl
# Usage: httpme
# Serve static files from current working directory
use Cwd;
use Plack::Runner;
use Plack::App::Directory;
my $runner = Plack::Runner -> new;
@ghedo
ghedo / Demo.c
Created March 29, 2011 20:11
Haiku demo app
#include "Demo.h"
#include <StringView.h>
#include <Window.h>
Demo::Demo(void) : BApplication("application/x-vnd.Demo") {
BRect rect(150, 150, 500, 500);
BWindow *win = new BWindow(
rect, "Demo",
B_TITLED_WINDOW,