Skip to content

Instantly share code, notes, and snippets.

@bitc
bitc / export_github_issues.py
Created May 23, 2016 11:34
Export GitHub issues of a single repository (including comments) to JSON file
import requests
import json
GITHUB_USER = ''
GITHUB_PASSWORD = ''
REPO = '' # format is username/repo
ISSUES_FOR_REPO_URL = 'https://api.github.com/repos/%s/issues?state=all' % REPO
name: test
version: 0.1.0.0
license: BSD3
license-file: LICENSE
author: captain
maintainer: <>
build-type: Simple
extra-source-files: ChangeLog.md
cabal-version: >=1.10
@bitc
bitc / hdevtools-stack.md
Last active January 22, 2018 14:42
Using hdevtools "classic" with stack

Hardcore way of using "classic" version of hdevtools with stack.

First build and install the "classic" version of hdevtools, using stack:

$ cd /tmp
$ git clone --depth 1 https://github.com/bitc/hdevtools.git
$ cd hdevtools
# Modify the flags in the following line to use the same settings you use in your project:
$ stack --install-ghc --no-system-ghc --resolver lts-7.1 init

$ stack install

#!/bin/bash
find $1 -name '*.hs' | sed "s%$1%%" | sed 's/\.hs/,/' | sed 's%/%\.%g'
# This file is a minimal clang-format vim-integration. To install:
# - Change 'binary' if clang-format is not on the path (see below).
# - Add to your .vimrc:
#
# map <C-I> :pyf <path-to-this-file>/clang-format.py<cr>
# imap <C-I> <c-o>:pyf <path-to-this-file>/clang-format.py<cr>
#
# The first line enables clang-format for NORMAL and VISUAL mode, the second
# line adds support for INSERT mode. Change "C-I" to another binding if you
# need clang-format on a different key (C-I stands for Ctrl+i).
#!/bin/bash
case $1 in
"--interactive")
echo $@ > /dev/stderr
;;
*)
ghc $@
;;
esac
@bitc
bitc / notes.sh
Last active November 27, 2017 21:41
Haskell Install GHC via stack
$ stack path --no-system-ghc --install-ghc --compiler ghc-8.2.2 --compiler-exe
$ $(stack path --no-system-ghc --install-ghc --compiler ghc-8.2.2 --compiler-exe) --version
$ cabal new-build --with-ghc=$(stack path --no-system-ghc --install-ghc --compiler ghc-8.2.2 --compiler-exe)
@bitc
bitc / example.hs
Created December 2, 2017 23:29
Run Haskell script using stack
#!/usr/bin/env stack
{- stack
script
--resolver lts-9.14
--install-ghc
--package stm,async,shelly
-}
import System.Info

IRC Setup: weechat (bouncer-like) + gotty + Glowing Bear

Abstract:

weechat IRC chat client (also acts like a bouncer) runs inside a tmux session(called weechat). This tmux session can also be accessed through any web browser via gotty. We can also connect to weechat from different clients using its "relay" feature. gotty and the weechat relay are secured with TLS behind an nginx reverse proxy(using letsencrypt).

systemd User Services

Reference: http://www.mythmon.com/posts/2015-02-15-systemd-weechat.html

@bitc
bitc / windows_disable_win_key.txt
Created September 13, 2018 21:30
Windows Disable Win Key
Start -> Run
gpedit.msc
User Configuration -> Administrative Templates -> Windows Components -> Windows Explorer
Turn off Windows+X hotkeys ==> "Enabled"
User Configuration -> Administrative Templates -> System -> Ctrl+Alt+Del Options