Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View mmmunk's full-sized avatar

Thomas Munk mmmunk

View GitHub Profile
import os.path
import sys
from gi.repository import Gtk, GdkPixbuf
import signal
signal.signal(signal.SIGINT, signal.SIG_DFL)
path = sys.argv[1]
anonymous
anonymous / google_cast_sample.htm
Created March 12, 2016 16:06
Google Cast (Chromecast) JavaScript API custom URL sender sample
<!DOCTYPE html>
<html>
<head>
<script src='https://www.gstatic.com/cv/js/sender/v1/cast_sender.js'></script>
<script>
function onError() {
document.getElementById('message').innerHTML = 'Error';
}
window['__onGCastApiAvailable'] = function(loaded, errorInfo) {
@ax003d
ax003d / https_server.py
Created August 12, 2015 14:53
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")
@Soulstorm50
Soulstorm50 / Gallary
Created November 1, 2016 20:31
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' \
import sys
import gi
gi.require_version('Clutter', '1.0')
gi.require_version('Gtk', '3.0')
gi.require_version('GtkClutter', '1.0')
from gi.repository import Clutter # isort:skip
from gi.repository import Gtk # isort:skip
@gipi
gipi / client.c
Created May 21, 2012 09:43
Unix socket
#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;
@akent
akent / photobooth.py
Last active December 29, 2022 12:47
#!/usr/bin/env python3
#
# photobooth.py
#
# Based on py-slideshow by Corey Goldberg
# Copyright (c) 2013, 2015, Corey Goldberg
# Copyright (c) 2019-2020 Adam Kent
#
# Dev: https://github.com/cgoldberg/py-slideshow
# License: GPLv3
@sahib
sahib / clutter.py
Created May 4, 2013 19:56
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
BROWSERS = 42
class ClutterBrowser(Gtk.ApplicationWindow):
@leoloobeek
leoloobeek / get_gists.py
Created April 26, 2017 21:34
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
@astagi
astagi / compile
Created October 12, 2011 22:14
Just a simple experimental way to embed python in Vala
valac python.vapi pyembtest.vala -X -I. -X -I/usr/include/python2.6 -X -lpython2.6 -o pyembtest