Skip to content

Instantly share code, notes, and snippets.

Avatar
🙀

Kamil Kisiel kisielk

🙀
View GitHub Profile
@kisielk
kisielk / linnstrument.sc
Last active Aug 27, 2021
Linnstrument + Supercollider
View linnstrument.sc
(
var notes, synths, on, off, mod, bend, touch;
~num_channels = 8;
~bend_range = 24;
MIDIIn.connectAll;
notes = Array.newClear(~num_channels);
synths = Array.newClear(~num_channels);
View gist:b3faaf4cbde1a5d026db
$ go-fuzz -workdir=fuzz -bin=securecookie-fuzz.zip
2015/08/18 11:44:35 slaves: 4, corpus: 100 (3s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 3s
2015/08/18 11:44:38 slaves: 4, corpus: 100 (6s ago), crashers: 0, restarts: 1/0, execs: 0 (0/sec), cover: 0, uptime: 6s
2015/08/18 11:44:41 slaves: 4, corpus: 100 (9s ago), crashers: 0, restarts: 1/6771, execs: 54173 (5953/sec), cover: 0, uptime: 9s
2015/08/18 11:44:44 slaves: 4, corpus: 100 (12s ago), crashers: 0, restarts: 1/8801, execs: 105620 (8756/sec), cover: 0, uptime: 12s
panic: runtime error: index out of range
goroutine 31 [running]:
github.com/dvyukov/go-fuzz/go-fuzz/versifier.structureKeyValue(0xc8203f6a80, 0x4, 0x4, 0x0, 0x0, 0x0)
/Users/kamil/src/github.com/dvyukov/go-fuzz/go-fuzz/versifier/versifier.go:695 +0x4a7
View gist:94273dba2da92e9c5c4b
include ../Makefile.inc
# Paths to gtest libraries
GTEST_HOME=../third_party/gtest-1.7.0
FUSED_GTEST_DIR = $(GTEST_HOME)/fused-src
FUSED_GTEST_H = $(FUSED_GTEST_DIR)/gtest/gtest.h
FUSED_GTEST_ALL_CC = $(FUSED_GTEST_DIR)/gtest/gtest-all.cc
GTEST_MAIN_CC = $(GTEST_HOME)/src/gtest_main.cc
CPPFLAGS += -I$(FUSED_GTEST_DIR) -DGTEST_HAS_PTHREAD=0
View euclidian.py
def E(h, n):
"""
Generates a euclidian rhythm.
Arguments:
k : The number of ones in the sequence.
n : The number of steps in the sequence.
See http://cgm.cs.mcgill.ca/~godfried/publications/banff.pdf
"""
@kisielk
kisielk / gist:7920552
Last active Dec 31, 2015
SQLite cares not for schemas.
View gist:7920552
~ $ sqlite3 foo.db
SQLite version 3.7.13 2012-07-17 17:46:21
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> create table foo ( f varchar(1) );
sqlite> .schema
CREATE TABLE foo ( f varchar(1) );
sqlite> insert into foo values ("hello world");
sqlite> select * from foo;
hello world
View gist:7730157
package mutexbench
import (
"runtime"
"sync"
"testing"
)
func BenchmarkMutex100(b *testing.B) { benchMutex(b, 1000) }
func BenchmarkMutex1000(b *testing.B) { benchMutex(b, 1000) }
View 4.2output.txt
Kamils-MacBook-Air:tmp kamil$ clang -v
Apple LLVM version 4.2 (clang-425.0.28) (based on LLVM 3.2svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
Kamils-MacBook-Air:tmp kamil$ go build -x
WORK=/var/folders/l7/xpn_29dn36qd97kgm79_8dg00000gn/T/go-build207250261
mkdir -p $WORK/_/Users/kamil/tmp/_obj/
mkdir -p $WORK/_/Users/kamil/
cd /Users/kamil/tmp
/Users/kamil/go.tip/pkg/tool/darwin_amd64/cgo -objdir $WORK/_/Users/kamil/tmp/_obj/ -- -I $WORK/_/Users/kamil/tmp/_obj/ foo.go
@kisielk
kisielk / Output
Created Sep 11, 2013
A benchmark of slice versus map iteration. Go 1.1.
View Output
BenchmarkSlice100 20000000 121 ns/op
BenchmarkSlice1000 1000000 1170 ns/op
BenchmarkSlice10000 200000 11658 ns/op
BenchmarkSlice100000 10000 116510 ns/op
BenchmarkMap100 5000000 670 ns/op
BenchmarkMap1000 200000 9249 ns/op
BenchmarkMap10000 20000 76125 ns/op
BenchmarkMap100000 2000 798339 ns/op
@kisielk
kisielk / gist:5172973
Created Mar 15, 2013
Timer, why u no fire?
View gist:5172973
var (
Forever = time.Duration(math.MaxInt64)
Debounce = time.Second
)
// Other unrelated things here
for {
t := time.NewTimer(Forever)
select {
@kisielk
kisielk / gist:5118235
Created Mar 8, 2013
errcheck run on the stdlib
View gist:5118235
/Network/Cluster/home/kamil/go/src/pkg/archive/tar/reader.go:66:3 mergePAX(hdr, headers)
/Network/Cluster/home/kamil/go/src/pkg/crypto/tls/conn.go:489:6 c.setError(err)
/Network/Cluster/home/kamil/go/src/pkg/crypto/tls/conn.go:500:5 c.sendAlert(alertProtocolVersion)
/Network/Cluster/home/kamil/go/src/pkg/crypto/tls/conn.go:530:6 c.setError(err)
/Network/Cluster/home/kamil/go/src/pkg/crypto/tls/conn.go:543:5 c.sendAlert(alertRecordOverflow)
/Network/Cluster/home/kamil/go/src/pkg/crypto/tls/conn.go:550:5 c.sendAlert(alertUnexpectedMessage)
/Network/Cluster/home/kamil/go/src/pkg/crypto/tls/conn.go:554:6 c.sendAlert(alertUnexpectedMessage)
/Network/Cluster/home/kamil/go/src/pkg/crypto/tls/conn.go:558:6 c.setError(io.EOF)
/Network/Cluster/home/kamil/go/src/pkg/crypto/tls/conn.go:567:6 c.setError(&net.OpError{Op: "remote error", Err: al