Skip to content

Instantly share code, notes, and snippets.

View profil's full-sized avatar

Daniel Skoog profil

  • Amazon Web Services
  • Sweden
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am profil on github.
  • I am profil (https://keybase.io/profil) on keybase.
  • I have a public key ASDSPydnwnlJjX0ix5jurNY1AodD7xhwn8FBZRlThTItFQo

To claim this, I am signing this object:

CC=g++
.cpp.o:
${CC} $< -o $@
ahencode: ahencode.o filter.o adaptiveHuffman.o
${CC} $< -o $@
ahdecode: ahdecode.o filter.o adaptiveHuffman.o
${CC} $< -o $@
@profil
profil / spotify-hotkeys.js
Last active August 29, 2015 14:05
Spotify web app hotkeys
document.addEventListener('keydown', function(e) {
var buttonId;
switch(e.which) {
case 176:
buttonId = 'next';
break;
case 179:
buttonId = 'play-pause';
break;
case 177:
@profil
profil / 175.hs
Last active August 29, 2015 14:05
r/dailyprogrammer #175
import System.Environment (getArgs)
import System.Random
import Data.List (permutations)
shuffle :: String -> IO String
shuffle xs = do
gen <- newStdGen
let (randIndex, _) = randomR (0, length ys - 1) gen
return $ ys !! randIndex
where
/tmp $ cat fizzbuzz.hs
import Data.Monoid ((<>))
(d .> s) n = if n `mod` d == 0 then s else ""
fizzbuzz n = case (3 .> "fizz" <> 5 .> "buzz") n of
"" -> show n
a -> a
main = mapM_ (putStrLn . fizzbuzz) [1..100]