Skip to content

Instantly share code, notes, and snippets.

View tsuriga's full-sized avatar

Tsuri Kamppuri tsuriga

View GitHub Profile
@tsuriga
tsuriga / gist:5085070
Last active February 8, 2022 23:00
EffectServer example in English. The actual server with a mockup option can be forked at https://github.com/epeli/effectserver/. I did not test this myself, but the same code (originally in Finnish) has been used at a LAN party for a few years now
#!/usr/bin/python
# -*- coding: utf-8 -*-
import socket
import time
class LightServer(object):
"""
Sends light commands to DMX light server. Can be used to envelope
multiple commands to a single packet.
@tsuriga
tsuriga / .htaccess
Last active August 29, 2015 14:04
A simple API with PHP
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [QSA,L]
@tsuriga
tsuriga / app.html
Last active April 23, 2024 10:18
Saving and loading files in an Electron application
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Tsuri's Electron Note Sample App</title>
<link href="./app.css" rel="stylesheet" />
<script src="app.js"></script>
</head>
<body>
<h1>Welcome to note sample app!</h1>
@tsuriga
tsuriga / config.ini
Created March 20, 2016 13:48
Simple config file validation in python
[DEFAULT]
; Operation mode
; This is a global value for all sections
mode = master
[server]
; Connection lifetime
timeout = 3600