Skip to content

Instantly share code, notes, and snippets.

Avatar
🌍
Doing stuff

Jan Krutisch halfbyte

🌍
Doing stuff
View GitHub Profile
@halfbyte
halfbyte / package-lock.json
Last active March 9, 2018 12:23
Setup for npm --package-lock-only bug
View package-lock.json
{
"name": "package-lock-only-bug",
"version": "1.0.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"acorn": {
"version": "5.5.3",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.5.3.tgz",
"integrity": "sha512-jd5MkIUlbbmb07nXH0DT3y7rDVtkzDi4XZOUVWAer8ajmF/DTSSbl5oNFyDOl/OXA33Bl79+ypHhl2pN20VeOQ==",
@halfbyte
halfbyte / iocc.c
Created June 2, 2017 07:37
Reformatted entry for IOCC, originally planned to be in my aesthetics of code talk
View iocc.c
# From: http://ioccc.org/2015/mills2/hint.html
int I=256, l, c, o, O=3;
void e(int L) {
o=0;
for(l=8; L >> ++l && 16 > l; o += l << l - 1);
o += l * L - (l << l - 1);
if (pread(3, &L, 3, O + o / 8) < 2) exit(0);
L >>= 7 & o;
L %= 1 << l;
@halfbyte
halfbyte / format.md
Last active December 21, 2016 10:49
Format Description of Modal Electronics CRAFT SysEx messages
View format.md

The Messages

When ever you switch or save presets from the hardware, the synth sends two sysex messages. They both start with a common header:

F0 00 21 07 64 CMD PATCHNO

Where CMD is 02 on the first message and 03 on the second and PATCHNO is 0-15 for the patch number.

@halfbyte
halfbyte / lets talk about JS's shortcomings.md
Last active April 3, 2016 17:05
A draft of an Article that wanted to be written after the left-pad drama and the parallel discussion on the super-small-npm-modules approach
View lets talk about JS's shortcomings.md

Preface

I like to call myself a web developer. Some people would call me "full stack" developer, but I'm absolutely terrible at writing file system, so, no.

As a web developer, since 1996, I have written code, markup and styles in HTML, CSS, Perl, PHP, JavaScript, Java, Ruby, Tcl, Python, C (yes, at one point I wrote CGI-Scripts in C), Haxe, Flash, Coffeescript and probably also a handful of other more obscure languages I can't even remember. I'm not writing this to brag (although that's a nice side effect, of course) but to make clear to you, the reader, that the following is not a rant by a disgruntled Rubby engineer who hates JavaScript.

In terms of modern JavaScript, I've spent some time, on and off, during the last, say, 6 years, in dabbling with node.js,

@halfbyte
halfbyte / Gemfile
Created December 21, 2014 01:22
A Simple Calendar generator. Very specific for my case - Probably going to make it more configurable one day.
View Gemfile
source "https://rubygems.org"
gem "prawn"
@halfbyte
halfbyte / abwaschen_vs_pappteller.md
Last active August 29, 2015 14:05
Kurze Überschlagsrechnung für Pappteller vs. Handwäsche (Nur Energie)
View abwaschen_vs_pappteller.md

Disclaimer

Wild zusammengesuchte, kaum belastbare Zahlen, aber als Größenordnungseinschätzungsversuch vermutlich ausreichend.

Überschlagsrechnung

"Graue Energie" für 500st Kopierpapier: 41kWh (pro Blatt: 5g, also für 2,5kg)

1 Pappteller: 18,53g (also 41kWh für ~135 Pappteller)

@halfbyte
halfbyte / keybase.md
Created March 29, 2014 12:33
Github proof
View keybase.md

Keybase proof

I hereby claim:

  • I am halfbyte on github.
  • I am halfbyte (https://keybase.io/halfbyte) on keybase.
  • I have a public key whose fingerprint is CF40 36B2 DBC8 83BA 29F1 3745 D400 34B1 A3E5 2A33

To claim this, I am signing this object:

@halfbyte
halfbyte / index.js
Last active August 29, 2015 13:56
Super Simple Kritzler API
View index.js
var port = "/dev/cu.usbmodem1421"
var serialPort = require("serialport");
var express = require('express');
var app = express();
var SerialPort = serialPort.SerialPort; // localize object constructor
var sp = new SerialPort(port, {
baudrate: 57600,
@halfbyte
halfbyte / dub_techno.js
Created January 11, 2014 13:42
A demonstration of some new elements in liv3c0der I did for my WCDC talk.
View dub_techno.js
// NAME: default
AE.Instance.tempo = 120;
AE.Instance.groove = 0.0;
function draw(c, s) {
LC.cls(c)
}
@halfbyte
halfbyte / lednet.cpp
Created November 29, 2013 22:43
Arduino experiment to drive some DIODER from IKEA via OSC by using an Arduino and a small ruby script.
View lednet.cpp
#include <SPI.h>
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <util.h>
// color swirl! connect an RGB LED to the PWM pins as indicated