I hereby claim:
- I am vincenthz on github.
- I am vhz (https://keybase.io/vhz) on keybase.
- I have a public key ASD8I4pHNuWa8DybHy-jiRnWMXcXb_xMkIz2KuYylfwXQAo
To claim this, I am signing this object:
#!/bin/sh | |
# | |
# Close all issues, PR, and archive a repository | |
if [ $# -ne 1 ]; then | |
echo "usage: $0 <github-repository>" | |
exit 1 | |
fi | |
REPO=$1 |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env stack | |
-- stack --resolver lts-9.17 script --package warp --package wai --package http-types | |
{-# LANGUAGE OverloadedStrings #-} | |
import Network.Wai (responseLBS, responseFile, Application, rawPathInfo) | |
import Network.Wai.Handler.Warp (run) | |
import Network.HTTP.Types (status200, status404) | |
import Network.HTTP.Types.Header (hContentType) | |
main = do |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
module Main where |
{-# LANGUAGE TypeFamilies #-} | |
{-# LANGUAGE TypeApplications #-} | |
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE TypeOperators #-} | |
{-# LANGUAGE UndecidableInstances #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE AllowAmbiguousTypes #-} | |
module CStruct where |
import qualified Data.ByteArray.Encoding as BD | |
import Debug.Trace | |
bytedump n f a = trace ("[HS] " ++ n ++ " " ++ toHex (f a)) a | |
where toHex = (show :: ByteString -> String) . BD.convertToBase BD.Base16 | |
funkyShow :: Show a => a -> String | |
funkyShow l = "\x1b[" ++ c ++ dig ++ "\x1b[0m" | |
where | |
c = cols !! (fromEnum (head dig) `mod` lenCols) | |
dig = show l | |
lenCols = length cols | |
cols = ["31;1m", "32;1m", "33;1m", "34;1m", "35;1m", "36;1m"] {-"37;1m", "38;1m", "7m"] -} |
-- | |
-- Preboot -- Prelude Reboot | |
-- | |
-- A minimal prelude reboot with better base classes | |
-- | |
-- * Provide a module to Work with the RebindableSyntax extension | |
-- * Better classes: | |
-- * Monad : no return or fail | |
-- * Enum : hiding fromEnum and toEnum | |
-- * Number Literal become the Integral class (e.g. Int) or Fractional class (e.g. Double). |
module Main where | |
import Control.Applicative | |
import Control.Monad | |
import System.Environment | |
import System.Process | |
import Data.Function | |
import Data.Word | |
import Data.List (sortBy) | |
import Numeric |
-- github util | |
-- | |
-- Expect a file called ~/.github-cred with your oauth string in first line. | |
-- Otherwise all commands are run without credentials | |
module Main where | |
import Control.Applicative | |
import Control.Exception | |
import Control.Monad | |
import Data.List |