Skip to content

Instantly share code, notes, and snippets.

View heyLu's full-sized avatar

Luna Stadler heyLu

  • Leipzig
  • 00:39 (UTC +01:00)
View GitHub Profile
@heyLu
heyLu / mvn.sh
Created June 13, 2016 11:41
Searching maven using curl (and jq)
curl -s 'http://search.maven.org/solrsearch/select?q=g:org.clojure+AND+a:test.check+AND+p:jar&core=gav&rows=1&wt=json' | jq '.response.docs[]'
@heyLu
heyLu / unix-socket.go
Created June 7, 2016 07:48
Unix sockets in Go
package main
import (
"fmt"
"net"
"os"
"os/signal"
"time"
)
@heyLu
heyLu / packages-by-size.sh
Created April 19, 2016 18:04
Packages sorted by size
#!/bin/sh
pacman -Qi | grep -e '^Installed Size' -e '^Name' -e '^$' | perl -0777 -pe 's/Name\s+: ([-.a-zA-Z0-9]+)\nInstalled Size\s+: ([^\n]+) ([KM])iB\n/\2\3\t\1/gs' | sort -h
@heyLu
heyLu / commandline-resources.md
Created April 19, 2016 14:41
Resources for learning the commandline
@heyLu
heyLu / keybase.md
Created March 16, 2016 12:49
Keybase

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@heyLu
heyLu / random-noise.js
Created November 23, 2015 14:35
Visualize the output of Math.random()
document.head.innerHTML = "<title>Math.random() noise!</title>"; document.body.innerHTML = "<canvas></canvas>"; canvas = document.querySelector("canvas"); canvas.width = canvas.height = 300; ctx = canvas.getContext("2d"); ctx.clearRect(0, 0, canvas.width, canvas.height); for (let x = 0; x < canvas.width; x++) { for (let y = 0; y < canvas.height; y++) { r = Math.floor(Math.random() * 255); ctx.fillStyle = `rgb(${r}, ${r}, ${r})`; ctx.fillRect(x, y, 1, 1); } }
@heyLu
heyLu / pretty-api.go
Created October 3, 2015 08:01
An experiment towards a nice http api in Go
// An experiment towards a nice http api in Go
//
// What is a "pretty" api?
//
// - content negotiation (including errors)
// - public vs internal errors
// - extensible (i.e. additional formats can be added easily)
//
// The current implementation has the first two, but not the last.
package main
@heyLu
heyLu / minutia.go
Last active September 29, 2015 14:48
/*
* A little experiment with date parsing.
*/
package main
import (
"fmt"
"regexp"
"strconv"
"time"
@heyLu
heyLu / run.go
Last active September 10, 2015 09:45
package main
import (
"bytes"
"fmt"
"io"
"os"
"os/exec"
)
@heyLu
heyLu / index.html
Created May 8, 2015 18:42
Raymarching (in a box)
<!doctype html>
<!--
The real/complete code is at https://github.com/heyLu/lp/tree/master/glsl
-->
<html>
<head>
<title>Raymarching!</title>
</head>
<body>