Skip to content

Instantly share code, notes, and snippets.

View r41d's full-sized avatar

Lennart Buhl r41d

View GitHub Profile
deb http://deb.debian.org/debian stretch main
deb-src http://deb.debian.org/debian stretch main
deb http://deb.debian.org/debian-security/ stretch/updates main
deb-src http://deb.debian.org/debian-security/ stretch/updates main
deb http://deb.debian.org/debian stretch-updates main
deb-src http://deb.debian.org/debian stretch-updates main
@r41d
r41d / make
Last active October 24, 2018 23:19
all: appimage
application: application.vala
valac --pkg gtksourceview-3.0 $< -o application
APPDIR=AppDir
appimage: application
$(shell [ -d ${APPDIR} ] && rm -r ${APPDIR}) # rm AppDir if exists
import numpy as np
# Source: http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html
# chromaticity coordinates
# values are for sRGB (http://www.brucelindbloom.com/index.html?WorkingSpaceInfo.html)
xr, xg, xb = 0.6400, 0.3000, 0.1500
yr, yg, yb = 0.3300, 0.6000, 0.0600
# Reference Whites in XYZ, source: https://de.mathworks.com/help/images/ref/whitepoint.html
package com.ikea.tradfri.lighting.ipso;
public class IPSOObjects {
public static final String AUTH_PATH = "9063";
public static final String CLIENT_IDENTITY_PROPOSED = "9090";
public static final String COLOR = "5706";
public static final String COLOR_X = "5709";
public static final String COLOR_Y = "5710";
public static final String COMMISSIONING_MODE = "9061";
public static final String CREATED_AT = "9002";
@r41d
r41d / tradpy.py
Last active April 6, 2017 16:22
Minimal flask Trådfri server
#!/usr/bin/env python
# -*- coding: utf-8 *-*
# TradPy, minimal working example for Trådfri web interface
# Copyright (C) 2017 Lennart Buhl
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful,
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <unistd.h>
#include <signal.h>
#include <ncurses.h>
/*
#!/usr/bin/env python
# -*- coding: utf-8 *-*
# not intended to be clean code (whole project was done in 20 minutes)
import pygame
from pygame.locals import K_SPACE, K_ESCAPE, KEYUP, KEYDOWN, QUIT
from random import randint, randrange
import os.path as path
from glob import glob
X = 640
#!/usr/bin/env python
# -*- coding: utf-8 *-*
# not intended to be clean code (whole project was done in 20 minutes)
import pygame
from pygame.locals import K_SPACE, K_ESCAPE, KEYUP, KEYDOWN, QUIT
from random import randint, randrange
import os.path as path
from glob import glob
X = 640
@r41d
r41d / sl.c
Created February 7, 2016 11:30
stripped version of SL 5.02 in one file without any arguments or special features
/*========================================
* sl.c: SL version 5.02 - stripped
* Copyright 1993,1998,2014
* Toyoda Masashi
* (mtoyoda@acm.org)
* Last Modified: 2014/06/03
*========================================
*/
#define D51HEIGHT 9
# original XML at http://www.w3.org/Math/characters/unicode.xml
# XSL for conversion: https://gist.github.com/798546
unicode_to_latex = {
u"\u0020": "\\space ",
u"\u0023": "\\#",
u"\u0024": "\\textdollar ",
u"\u0025": "\\%",
u"\u0026": "\\&amp;",