Skip to content

Instantly share code, notes, and snippets.

@edne
edne / playing_with_tweets.py
Created June 18, 2015 19:14
utilizzo real-world di python
# Politecnico Open unix Labs (https://poul.org)
# Edoardo Negri (http://edne.net)
from tweepy import OAuthHandler
from tweepy.streaming import StreamListener
from tweepy import Stream
import json
# per poter usare le API di Twitter è necessario registare l'app
@edne
edne / doublestack.hs
Last active August 29, 2015 14:22
Principles of Programming Languages homework
import Control.Monad.State -- to use get and put
main :: IO ()
main = do
print $ test $ DoubleStack [1,2,3] [4,5,6]
print $ test $ DoubleStack [] [4,5,6]
where
-- the test function
test :: DoubleStack Integer -> Maybe Integer
@edne
edne / defmacro.rkt
Created April 1, 2015 20:21
playing with macros inside macros: a Clojure-like defmacro in Racket
(define-syntax defmacro
(syntax-rules
()
((defmacro (name . args)
(body ...))
(define-syntax name
(syntax-rules
()
((name . args) (body ...)))))))
@edne
edne / jump-up.hy
Last active August 29, 2015 14:16
When a friend (who cares more BPMs than bitrate) ask you "Can you make me a CD?", and you know what he likes
#! /usr/bin/env hy
(import [sh [cat du rm youtube-dl]]
[soundcloud [Client]])
(def SIZE 700)
(def MIN_BPM 170)
(def MAX_DURATION 10)
(def GENRE "jump up")

Keybase proof

I hereby claim:

  • I am edne on github.
  • I am edne (https://keybase.io/edne) on keybase.
  • I have a public key whose fingerprint is 23E4 BBA2 82CC B767 184B 90E7 F532 8D6D F593 04E2

To claim this, I am signing this object: