Skip to content

Instantly share code, notes, and snippets.


Thomas Munk mmmunk

View GitHub Profile
astagi / compile
Created Oct 12, 2011
Just a simple experimental way to embed python in Vala
View compile
valac python.vapi pyembtest.vala -X -I. -X -I/usr/include/python2.6 -X -lpython2.6 -o pyembtest
gipi / client.c
Created May 21, 2012
Unix socket
View client.c
#include <stdio.h>
#include <sys/socket.h>
#include <linux/un.h>
#include <unistd.h>
#include <string.h>
int main(void)
struct sockaddr_un address;
int socket_fd, nbytes;
import os.path
import sys
from gi.repository import Gtk, GdkPixbuf
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
path = sys.argv[1]
sahib /
Created May 4, 2013
Playing around with Python/Clutter/Gtk. Simple Swipe Effect.
from gi.repository import GLib, Gtk, GtkClutter, Clutter, Gdk, GdkPixbuf
import sys
from random import random
class ClutterBrowser(Gtk.ApplicationWindow):
wandernauta / sp
Last active Sep 18, 2022
sp is a command-line client for Spotify's dbus interface. Play, pause, skip and search tracks from the comfort of your command line.
View sp
#!/usr/bin/env bash
# This is sp, the command-line Spotify controller. It talks to a running
# instance of the Spotify Linux client over dbus, providing an interface not
# unlike mpc.
# Put differently, it allows you to control Spotify without leaving the comfort
# of your command line, and without a custom client or Premium subscription.
jasonruyle /
Last active Sep 5, 2022
UFW to block countries
ax003d /
Created Aug 12, 2015
tornado https server
import ssl
from tornado.httpserver import HTTPServer
from tornado.web import Application, RequestHandler
from tornado.ioloop import IOLoop
class TestHandler(RequestHandler):
def get(self):
self.write("Hello, World!\n")
anonymous / google_cast_sample.htm
Created Mar 12, 2016
Google Cast (Chromecast) JavaScript API custom URL sender sample
View google_cast_sample.htm
<!DOCTYPE html>
<script src=''></script>
function onError() {
document.getElementById('message').innerHTML = 'Error';
window['__onGCastApiAvailable'] = function(loaded, errorInfo) {
View Gallary
#include <windows.h>
#include <string>
#include "resource.h"
#include <vector>
#include <string>
#include <tchar.h>
#include <io.h>
using namespace std;
#pragma comment(linker, "\"/manifestdependency:type='win32' \
leoloobeek /
Created Apr 26, 2017
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/ .
# python3 user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('{0}/gists'.format(user))