Skip to content

Instantly share code, notes, and snippets.

@BjoernSchilberg
BjoernSchilberg / minibrowser.c
Last active December 27, 2015 03:49
minibrowser
#include <webkit/webkit.h>
static void entry_activated (GtkEntry *entry, WebKitWebView *embed)
{
webkit_web_view_load_uri (embed, gtk_entry_get_text (entry));
}
int main (int argc, char** argv)
{
gtk_init (&argc, &argv);
/* Widgets and signals */
GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
@BjoernSchilberg
BjoernSchilberg / README.md
Last active September 7, 2018 11:23
SSL HTTP server in Python 2

README

Generate a self-signed certificate compounded of a certificate and a private key for your server with the following command (it outputs them both in a single file named server.pem):

openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@BjoernSchilberg
BjoernSchilberg / cors_server.py
Created April 15, 2015 14:32
cors_server.py
import SimpleHTTPServer
import urllib
class CORSHTTPRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
def send_head(self):
PREFIX = "/ogcproxy?url="
"""Common code for GET and HEAD commands.
@BjoernSchilberg
BjoernSchilberg / README.md
Last active September 7, 2018 11:39
Download csv files from google docs spreadsheet and import in Microsoft Excel

README

Download csv files from google docs spreadsheet

curl "https://docs.google.com/spreadsheets/d/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/export?format=csv"

Import to Microsoft Excel

@BjoernSchilberg
BjoernSchilberg / README.md
Last active August 28, 2015 08:12
mpg123 keyboard control
-= terminal control keys =-
[s] or [ ] interrupt/restart playback (i.e. 'pause')
[f] next track
[d] previous track
[b] back to beginning of track
[p] pause while looping current sound chunk
[.] forward
[,] rewind
[:] fast forward
@BjoernSchilberg
BjoernSchilberg / README.md
Last active June 12, 2020 18:55
Programmieraufgaben fizzbuzz & co

Programmieraufgaben

Fizzbuzz

for i in xrange(1, 101):
    if i % 15 == 0:
        print "FizzBuzz"
 elif i % 3 == 0:
@BjoernSchilberg
BjoernSchilberg / README.md
Last active September 26, 2018 07:30
droopy