Skip to content

Instantly share code, notes, and snippets.

View gosub's full-sized avatar

Giampaolo Guiducci gosub

View GitHub Profile
@gosub
gosub / emacs_27.1_linux_primitive_functions.txt
Created October 25, 2020 19:21
List of primitive functions in my Emacs version (27.1 on Linux)
read-char
locale-info
make-symbolic-link
controlling-tty-p
set-buffer-major-mode
global-key-binding
get-buffer
font-get-glyphs
position-bytes
set-window-parameter
@gosub
gosub / very_cool_patch_challenge.csv
Last active June 21, 2020 12:57
Record of "Very Cool Patch Challenge" (VCP) editions, modules and rules
edition module or rules plugin
1 Portland Weather Frozen Wasteland
2 PO-204 Phase Modulation Engine Submarine
3 Uncertain Xor
4 Bouncy Balls JW Modules
5 Chaos Qwelk
6 [No normal sound generators]
7 Mr Chainkov Unless Games
8 Luppolo3 Sonus Modular
9 Dexter Valley
@gosub
gosub / wallpaper_sketch_2019-04-12.js
Created April 12, 2019 12:07
Phone wallpaper sketch 2019-04-12
// wallpaper sketch 2019-04-12
// by Giampaolo Guiducci
// [email protected]
// https://github.com/gosub
// render with: editor.p5js.org
function setup() {
var scale = 1;
createCanvas(1080/scale, 1920/scale);
colorMode(HSB);
@gosub
gosub / png_text_embed.sh
Created April 3, 2019 17:12
linux shell command to embed into a PNG image its source code
# image: image.png
# source code: image.js
# final image: final.png
convert image.png -set sourcecode "$(<image.js)" final.png
# verify with
identify -format '%[sourcecode]' final.png
@gosub
gosub / wallpaper_sketch_2019-04-03.js
Created April 3, 2019 17:05
Phone Wallpaper Sketch 2019-04-03
// wallpaper sketch 2019-04-03
// by Giampaolo Guiducci
// [email protected]
// https://github.com/gosub
// render with: editor.p5js.org
function setup() {
createCanvas(1080, 1920);
background(30);
//noStroke();
@gosub
gosub / hn_time_machine.js
Last active December 31, 2017 10:43
Hacker News Time Machine
var t = new Date();
t.setFullYear(t.getFullYear() - 3);
var past = prompt("HN time machine", t.toISOString().substr(0,10));
if (past != null) {
var p = new Date(past);
var p1 = (new Date(p.getFullYear(), p.getMonth(), p.getDate(), 0, 0, 0, 0).getTime() + "").slice(0,-3);
var p2 = (new Date(p.getFullYear(), p.getMonth(), p.getDate(), 23, 59, 59, 0).getTime() + "").slice(0, -3);
var u = "https://hn.algolia.com/?query=&sort=byPopularity&prefix&page=0&dateRange=custom&type=story&dateStart=" + p1 + "&dateEnd="+ p2;
window.location.href=u;
}
@gosub
gosub / hn_3_years_ago.js
Created December 24, 2017 16:37
Hacker News 3 years ago
var t = new Date();
var y = t.getFullYear();
var m = t.getMonth();
var d = t.getDate();
var p1 = (new Date(y-3, m, d, 0,0,0,0).getTime() + "").slice(0,-3);
var p2 = (new Date(y-3, m, d, 23,59,0,0).getTime() + "").slice(0, -3);
var u = "https://hn.algolia.com/?query=&sort=byPopularity&prefix&page=0&dateRange=custom&type=story&dateStart=" + p1 + "&dateEnd="+ p2;
window.location.href=u;
@gosub
gosub / sc3-plugins.nix
Created February 23, 2016 16:18
Nix package definition for sc3-plugins
with import <nixpkgs> {};
stdenv.mkDerivation {
name = "sc3-plugins-3.7.0-beta";
src = fetchgit {
url = "https://github.com/supercollider/sc3-plugins";
rev = "a963ecb";
sha256="0840jwh7ljmhg34zblahqx3abk42a3y3gvgb740r558rphbp1p19";
fetchSubmodules = true;
@gosub
gosub / nokia_sms_tone.sh
Created July 28, 2015 11:22
Shell script to generate with SoX the famous nokia sms tone (SMS in morse)
#!/bin/sh
FILENAME="nokia_sms_tone_morse.wav"
# DOT = short bip, 0.1s
DOT="|sox -n -p synth 0.1 sine 2500 synth 0.1 sine mix 5000 synth 0.1 sine mix 7500"
# DASH = long bip, 0.3s
DASH="|sox -n -p synth 0.3 sine 2500 synth 0.3 sine mix 5000 synth 0.3 sine mix 7500"
@gosub
gosub / pontometro.py
Last active December 2, 2015 15:53
from datetime import date
# per ogni festa che cade di:
# sabato o domenica, -1 punto (niente ponte e niente festa)
# lunedi' o venerdi', +2 punti (niente ponte, ma festa dopo finesettimana)
# martedi' o giovedi', +3 punti (ponte!!)
# mercoledi', +1 punti (solo festa)
punteggio = [2, 3, 1, 3, 2, -1, -1]
feste = [(1,1), # capodanno
(6,1), # epifania