Skip to content

Instantly share code, notes, and snippets.

View Tehnix's full-sized avatar
🌞
Enjoying the code...

Christian Kjær Tehnix

🌞
Enjoying the code...
View GitHub Profile
@Tehnix
Tehnix / output.txt
Created October 31, 2017 16:07
Output of `nix-shell -p arcanist` on macOS High Sierra
λ ~ cd GitHub/Clones/ghc
λ Clones/ghc ‹master!› nix-shell -p arcanist
these derivations will be built:
/nix/store/g8sig0qlyr2kxifnwg0yf4wb6hm7pwsp-php-7.1.9.drv
/nix/store/qyhqpnnr68ir2kaydq58k5glh650kmxs-arcanist-20170323.drv
building path(s) ‘/nix/store/251b3gyl5z2pjj74xd9hw5r1hx2h3v8i-php-7.1.9-dev’, ‘/nix/store/cvxm3qph7wyfawfkzb8ccgry8j3lqk23-php-7.1.9’
unpacking sources
unpacking source archive /nix/store/nw3i2jy2a8mfab43gp26sr5pgg2blf23-php-7.1.9.tar.bz2
source root is php-7.1.9
setting SOURCE_DATE_EPOCH to timestamp 1504109600 of file php-7.1.9/win32/wsyslog.c
@Tehnix
Tehnix / TypeFun.hs
Last active October 27, 2017 11:05
Fun with Typeable and delegating to functions based on `typeOf`
import Data.Typeable
doSomethingOnType :: Typeable a => a -> IO ()
doSomethingOnType a =
case show (typeOf a) of
"Char" -> print $ performActionOnChar a
"Integer" -> print $ performActionOnInt a
_ -> print "undefined!"
performActionOnChar :: Typeable a => a -> String
@Tehnix
Tehnix / cross-ghc
Last active October 23, 2017 07:50
Script to easily manage hackage.mobilehaskell.org, setup with: curl -o /usr/local/bin/cross-ghc https://gist.githubusercontent.com/Tehnix/dd8a71322744bb92ef3176ebc6f0b7f9/raw/db0977544c66cfa3fed7ceea652f3b43c1c1c1d9/cross-ghc
#!/usr/bin/env bash
defaultToolchainWrapperPath="/usr/local/lib/toolchain-wrapper"
defaultLlvmPath="/usr/local/opt/llvm/bin"
defaultLibffiPath="/usr/local/opt/libffi/lib"
crossGhcDistributionPath="/usr/local/lib/cross-ghc"
# Distribution specific information.
ghcVersion="ghc-8.3.20171020"
commitHash="aa5f532d20"
@Tehnix
Tehnix / dump.txt
Created October 19, 2017 09:14
stack ghc -- -ddump-rule-rewrites -O2 LengthTest.hs
λ .testing/Haskell stack ghc -- -ddump-rule-rewrites -O2 LengthTest.hs
[1 of 1] Compiling LengthTest ( LengthTest.hs, LengthTest.o )
Rule fired
Rule: Class op length
Before: Data.Foldable.length
TyArg []
ValArg Data.Foldable.$fFoldable[]
TyArg GHC.Integer.Type.Integer
ValArg GHC.Base.build
@Tehnix
Tehnix / Foundation.hs
Created January 25, 2017 18:33
Overwrite loginHandler (not working atm)
loginHandler = do
ma <- lift maybeAuthId
when (isJust ma) $ lift $ redirect HomeR
toParentRoute <- getRouteToParent
master <- getYesod
(widget, enctype) <- generateFormPost loginForm
lift $
authLayout $ do
setTitle "Log In"
-- mapM_ (flip apLogin toParentRoute) (authPlugins master)
@Tehnix
Tehnix / DecodingTypes.elm
Created November 24, 2016 15:54
Attempt to decode union types
module DecodingTypes exposing (..)
import Json.Decode as Decode exposing (Decoder)
import Json.Decode.Pipeline exposing (decode, required)
-- | Order list segments
type OrderSegment
= Silver
| Gold
@Tehnix
Tehnix / output.log
Created November 3, 2016 02:43
Successful build when running `stack --stack-yaml=stack-docker.yaml build --verbose`
λ Tehnix/campaigns ‹master› $ stack --stack-yaml=stack-docker.yaml build --verbose
Version 1.2.0, Git revision 241cd07d576d9c0c0e712e83d947e3dd64541c42 (4054 commits) x86_64 hpack-0.14.0
2016-11-03 03:41:42.810982: [debug] Loading project config file stack-docker.yaml
@(Stack/Config.hs:810:13)
2016-11-03 03:41:42.813469: [debug] Run process: /usr/local/bin/docker --version
@(System/Process/Read.hs:277:3)
2016-11-03 03:41:42.828156: [debug] Process finished in 14 ms: /usr/local/bin/docker --version
@(System/Process/Read.hs:277:3)
2016-11-03 03:41:42.828689: [debug] Run process: /usr/local/bin/docker inspect fpco/stack-build:lts-6.20
@(System/Process/Read.hs:277:3)
@Tehnix
Tehnix / output.log
Created November 3, 2016 02:37
Stuck linking when running `stack --stack-yaml=stack-docker.yaml build --verbose`
λ Tehnix/campaigns ‹master› $ stack --stack-yaml=stack-docker.yaml clean
λ Tehnix/campaigns ‹master› $ stack --stack-yaml=stack-docker.yaml build --verbose
Version 1.2.0, Git revision 241cd07d576d9c0c0e712e83d947e3dd64541c42 (4054 commits) x86_64 hpack-0.14.0
2016-11-03 03:30:48.104575: [debug] Loading project config file stack-docker.yaml
@(Stack/Config.hs:810:13)
2016-11-03 03:30:48.107300: [debug] Run process: /usr/local/bin/docker --version
@(System/Process/Read.hs:277:3)
2016-11-03 03:30:48.123887: [debug] Process finished in 16 ms: /usr/local/bin/docker --version
@(System/Process/Read.hs:277:3)
2016-11-03 03:30:48.124406: [debug] Run process: /usr/local/bin/docker inspect fpco/stack-build:lts-6.20
@Tehnix
Tehnix / output.log
Created November 3, 2016 02:27
Stuck linking when running `stack --stack-yaml=stack-docker.yaml build`
λ Tehnix/campaigns ‹master› $ stack --stack-yaml=stack-docker.yaml clean
λ Tehnix/campaigns ‹master› $ stack --stack-yaml=stack-docker.yaml build
campaigns-0.0.0: configure
Configuring campaigns-0.0.0...
campaigns-0.0.0: build
Preprocessing library campaigns-0.0.0...
[ 1 of 26] Compiling Job.Types ( Job/Types.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-1.22.5.0/build/Job/Types.o )
[ 2 of 26] Compiling Internationalization.Types ( Internationalization/Types.hs, .stack-work/dist/x86_64-linux-dkda49f7ca9b244180d3cfb1987cbc9743/Cabal-1.22.5.0/build/Internationalization/Types.o )
/Users/tehnix/GitHub/Tehnix/campaigns/Internationalization/Types.hs:25:1: Warning:
@Tehnix
Tehnix / setup-atom.sh
Last active September 23, 2017 10:04
A list of Atom packages I usually would like
apm install \
atom-haskell \
autocomplete-php \
autocomplete-ruby \
autocomplete-python \
autocomplete-html-entities \
css-snippets \
javascript-snippets \
language-viml \
language-shakespeare \