This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro where [& body] | |
"where is identical to let, but with bindings | |
at the end of the argument list." | |
`(let ~(last body) | |
~@(butlast body))) | |
(-> 5 | |
(+ i) | |
(- j) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import sys | |
ms = int(sys.argv[1]) if len(sys.argv) > 1 else 250 | |
words, start = 0, time.time() | |
print "\n"*2 | |
try: | |
for line in sys.stdin: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var parser=new DOMParser();var ss=parser.parseFromString(atob(""),'application/xml');var xsltProcessor=new XSLTProcessor();xsltProcessor.importStylesheet(ss);var newdoc=xsltProcessor.transformToDocument(content.document);var myWindow=window.open("data:text/html,"+encodeURIComponent(newdoc.documentElement.innerHTML),"_blank","");myWindow.focus();}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Window | |
import Mouse | |
main = render <~ Window.dimensions ~ allMoves | |
mousePos = | |
let nomalize = \(w,h) (x,y) -> (toFloat x - toFloat w / 2, toFloat h / 2 - toFloat y) | |
in nomalize <~ Window.dimensions ~ Mouse.position | |
mouseDownAndPos = lift2 (,) Mouse.isDown mousePos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
OlderNewer