Skip to content

Instantly share code, notes, and snippets.

Christian Takle christiantakle

  • Moixa
  • London
View GitHub Profile
View youtube_get.sh
# brew install youtube-dl
function youtube_music
{
$(youtube-dl -f 37/22/18 "$1" --extract-audio --audio-format mp3 | tee /dev/tty)
}
function youtube_video
{
$(youtube-dl -f 37/22/18 "$1" | tee /dev/tty)
@bos
bos / AesonPlayground.hs
Last active Oct 18, 2016
A proof-of-concept of a new approach to encoding JSON values for aeson.
View AesonPlayground.hs
{-# LANGUAGE GeneralizedNewtypeDeriving, FlexibleInstances,
OverloadedStrings #-}
import Data.Monoid (Monoid(..), (<>))
import Data.String (IsString(..))
import Data.Text (Text)
import Data.Text.Lazy.Builder (Builder, singleton)
import qualified Data.Text.Lazy.Builder as Bld
import qualified Data.Text.Lazy.Builder.Int as Bld
@tolysz
tolysz / Synacor.hs
Created Jan 13, 2014
Some solution, still debug or (de)compile are missing.
View Synacor.hs
{-# LANGUAGE LambdaCase #-}
module Main where
import qualified Data.IntMap.Strict as M
import Data.Word
import Data.Char
import Control.Applicative
import Control.Monad
import Control.Monad.Trans.State.Lazy
@jtobin
jtobin / fix-free-cofree.hs
Created Dec 9, 2015
Fix, Free, and Cofree
View fix-free-cofree.hs
{-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE StandaloneDeriving #-}
{-# LANGUAGE UndecidableInstances #-}
import Prelude hiding (succ)
newtype Fix f = Fix (f (Fix f))
deriving instance (Show (f (Fix f))) => Show (Fix f)
@daig
daig / App.hs
Last active Jun 27, 2017
Elm/Flux style Component Architecture for Reflex-Dom
View App.hs
{-# LANGUAGE OverloadedStrings #-}
module App where
import Component
import Notes
import Reflex.Dom
import Data.Semigroup ((<>))
app :: MonadWidget t m => m ()
app = do
add <- (BlankNote <$) <$> button "New Note"
View stack.yaml
# https://mail.haskell.org/pipermail/ghc-devs/2017-July/014364.html
# https://downloads.haskell.org/~ghc/8.2.1-rc3/
# http://taylor.fausak.me/2017/05/17/testing-ghc-release-candidates-with-stack/
compiler: ghc-8.2.0.20170704
compiler-check: match-exact
resolver: ghc-8.2.0.20170704
setup-info:
ghc:
@carwin
carwin / private.xml
Last active Jul 27, 2017
Programmer's Shift Keys: Remapping parens, brackets and braces for to because nerd.
View private.xml
<?xml version="1.0"?>
<root>
<item>
<name>Programmer's Shift Keys</name>
<!--
Author: Carwin Young (@carwin)
Last Updated: 2014.07.18
v.1.1
Programmer's Shift Keys
@Cottser
Cottser / Custom.css
Created Sep 27, 2011
IR_Black Theme (with sidebar and view-source colors) for Chrome Developer Tools
View Custom.css
/**********************************************/
/*
/* IR_Black Skin by Ben Truyman - 2011
/*
/* Based on Todd Werth's IR_Black:
/* http://blog.toddwerth.com/entries/2
/*
/* Inspired by Darcy Clarke's blog post:
/* http://darcyclarke.me/design/skin-your-chrome-inspector/
/*
@elimisteve
elimisteve / goroutines2.go
Created Jan 3, 2013
Programming Challenge: Launch 4 threads, goroutines, coroutines, or whatever your language uses for concurrency, in addition to the main thread. In the first 3, add numbers together (see sample code below) and pass the results to the 4th thread. That 4th thread should receive the 3 results, add the numbers together, format the results as a strin…
View goroutines2.go
// Steve Phillips / elimisteve
// 2013.01.03
package main
import "fmt"
// intDoubler doubles the given int, then sends it through the given channel
func intDoubler(ch chan int, n int) {
ch <- n*2
@ToJans
ToJans / InventoryItems.hs
Last active Mar 26, 2018
Haskell implementation of Greg Young's CQRS sample: https://github.com/gregoryyoung/m-r Love the sheer elegance of Haskell; no need for all that infrastructure crap
View InventoryItems.hs
module InventoryItems(Command(..), Event(..), handle) where
import Data.Maybe(isJust)
type Id = String
type Name = String
type Amount = Int
data Command = CreateInventoryItem Id
| RenameInventoryItem Id Name
You can’t perform that action at this time.