Skip to content

Instantly share code, notes, and snippets.

View severak's full-sized avatar

Mikoláš Štrajt severak

View GitHub Profile
@maximecb
maximecb / music.csv
Created May 19, 2018 17:21
Python program to sequence MIDI music using a CSV spreadsheet
X kick snare
X
X
X
X kick
X
X
X
X kick snare clap
X
@dlundgren
dlundgren / IsStaticProxy.php
Created February 27, 2017 08:30
Static Proxy trait
<?php
/**
* Simple static proxy trait
*
* Aura DI is used for lazy loading
*
* Set `const PROXY_IDENTIFIER = "SomeClass" in your proxy class, and use this trait.
*
* Call `Some\Proxy\SomeClass::register(new SomeClassInstance)` to have it register the alias.
*
@electerious
electerious / Caddyfile
Created August 20, 2016 18:15
Most complete list of mime types in the correct format for the Caddy mime directive
mime {
.atom application/atom+xml
.json application/json
.map application/json
.topojson application/json
.jsonld application/ld+json
.rss application/rss+xml
.geojson application/vnd.geo+json
.rdf application/xml
.xml application/xml
@alexkirsz
alexkirsz / sixth-sense.js
Created May 23, 2016 18:56
Core hook of the Facebook Sixth Sense Chrome extension
function getUserId(fbid) {
return fbid.split(':')[1];
}
requireLazy(
['MercuryTypingReceiver', 'MercuryThreads', 'ShortProfiles'],
(MercuryTypingReceiver, MercuryThreads, ShortProfiles) => {
MercuryTypingReceiver
.get()
@genericpenguin
genericpenguin / synth.cpp
Created January 17, 2016 20:55
Arduino Synth
/* Arduino Synth from
https://janostman.wordpress.com/2016/01/15/how-to-build-your-very-own-string-synth/
*/
#include <avr/interrupt.h>
#include <avr/io.h>
#include <avr/pgmspace.h>
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
#endif
#ifndef sbi
@rbnpi
rbnpi / starwars.rb
Last active June 9, 2021 14:16
starwars.rb The StarWars theme arranged for Sonic Pi, based on a version by Max Loh http://www.maxloh.com/sheetmusic/ Hear it at https://soundcloud.com/rbnman/starwars
#Star Wars theme arranged for Sonic Pi by Robin Newman December 2015
#Based on arrangement by Max Loh www.maxloh.com featured on youtube
use_synth :dsaw
s=0.11 #adjust tempo here
sq=1*s #note timings
sq7=4*sq/7.0 #for semiquaver run
q=2*sq
qt=2/3.0*q #for triplets
@paragonie-scott
paragonie-scott / crypto-wrong-answers.md
Last active August 17, 2024 06:33
An Open Letter to Developers Everywhere (About Cryptography)
# Simple Beauty
# by jasisz
base = 0.5
probabilities = (
knit
-6,1,
-5,2,
-4,3,
@eXeC64
eXeC64 / depng.c
Created July 25, 2015 21:22
Quick tool to list and dump data chunks from a PNG file
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <endian.h>
int main(int argc, char** argv)
{
if(argc < 2)
return 1;
@rbnpi
rbnpi / SampleSymphony.rb
Created May 11, 2015 17:07
SampleSymphony for Sonic Pi. A piece that exploits most of the samples supplied with SonicPi
#Sample Symphony for Sonic Pi by Robin Newman, May 2015
#This program splits the internal samples in Sonic Pi up into their constituent groups or familes
#eg :bass_drums, :elec, :bass, :guit etc and then gradually introduces each group, with samples chosen at random
#from within them. Each group is started in a separate live_loop,separated by a sleep delay, so that they
#can be started in sequence. The sounds gradually build up as more and more groups are introduced.
#This is implemented by an fx :level command, which allows the volume to slowly build up to a maximum.
#The various live_loops are then killed off in the reverse sequence, and at the same time
#the level volume is reduced allowing the sound to die away again.
#The timings are carefully calculated for each loop using an iteration counter.
#The program uses all groups except :misc and :loop. The former is not vey musical! and the latter