Skip to content

Instantly share code, notes, and snippets.

@jonty-comp
jonty-comp / audiowall.py
Created May 12, 2013 15:45
Simple Audiowall page example in Kivy.
'''
Audiowall Page Example
=============
'''
import kivy
kivy.require('1.0.8')
from kivy.app import App
from kivy.clock import Clock
var redis = require("redis"),
http = require("http"),
socketio = require("socket.io"),
client = redis.createClient(),
// client2 = redis.createClient(),
fs = require("fs");
var server = http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/html'});
var fileStream = fs.createReadStream(__dirname + "/openob.html");
@jonty-comp
jonty-comp / gist:6989009
Created October 15, 2013 09:27
Example of simple callback / lambda function default thing in python2.
from __future__ import print_function
class AccessControl:
def __init__(self, **kwargs):
self.on_grant = kwargs.get('on_grant', lambda: print(1) )
def grant(self):
self.on_grant()
@jonty-comp
jonty-comp / local.php
Created June 22, 2016 18:31
configuring dokuwiki oauth plugin for Azure AD OpenID connect
$conf['plugin']['oauth']['custom-key'] = 'your-application-key';
$conf['plugin']['oauth']['custom-secret'] = 'your-application-secret';
$conf['plugin']['oauth']['custom-authurl'] = 'https://login.microsoftonline.com/your-tenant-id/oauth2/authorize';
$conf['plugin']['oauth']['custom-tokenurl'] = 'https://login.microsoftonline.com/your-tenant-id/oauth2/token';
$conf['plugin']['oauth']['custom-meurl'] = 'https://login.windows.net/your-tenant-id/openid/userinfo';
$conf['plugin']['oauth']['custom-mapping'] = 'user=upn name=name mail=upn';
$conf['plugin']['oauth']['custom-scope'] = 'openid';
$conf['plugin']['oauth']['singleService'] = 'Custom';
$conf['plugin']['oauth']['register-login'] = 1;
# APKBUILD based on linux-vanilla aport. Changes:
# - disabled module installation
# - add !check !tracedeps
# - package: just install zimage and kernel.release, because the kernel config
# does not generate modules or dtb files
# - do not create -dev subpackage (makes no sense without module support)
#
# Kernel config based on: arch/arm/configs/lineageos_mako_defconfig
# Changes:
# - enable devtmpfs (needed for udev -> touch support in weston)
@jonty-comp
jonty-comp / apollo.liq
Created March 9, 2018 21:19
Streaming to icecast and disk with Liquidsoap
#!/usr/bin/liquidsoap
# Icecast stream parameters
stream_host = "icecast.server.com"
stream_port = 80
stream_password = "hackme"
# Set up logging
set("log.level", 3)
set("log.stdout", true)