Skip to content

Instantly share code, notes, and snippets.

View iquiw's full-sized avatar
🦛
Do not underestimate hippopotamus

Iku Iwasa iquiw

🦛
Do not underestimate hippopotamus
View GitHub Profile
@iquiw
iquiw / gist:5894128
Last active December 19, 2015 03:59
Modified TwoPane layout. Not changing second window on mouse focus change.
-- Derived from xmonad-contrib/XMonad/Layout/TwoPane.hs
data TwoPaneMod a = TwoPaneMod Rational Rational deriving (Show, Read)
instance LayoutClass TwoPaneMod Window where
doLayout (TwoPaneMod _ split) r s = (,Nothing) <$> arrange r s
where
arrange rect st = do
ws <- mapped <$> get
let x = case reverse (W.up st) of
(master:_) -> [(master, left), (W.focus st, right)]
@iquiw
iquiw / gist:9156790
Created February 22, 2014 15:42
Turpial install instruction for Windows

Turpial install instruction for Windows

Prerequisite

  1. Python2.7 is installed (Python2.7.6)
  2. pip is installed. (pip)
@iquiw
iquiw / gist:10c49212fd59fc795c59
Created August 19, 2014 13:56
function-key-map
(keymap (27 . [escape]) (right-fringe keymap (mouse-3 . mouse--strip-first-event) (mouse-2 . mouse--strip-first-event) (mouse-1 . mouse--strip-first-event)) (left-fringe keymap (mouse-3 . mouse--strip-first-event) (mouse-2 . mouse--strip-first-event) (mouse-1 . mouse--strip-first-event)) (escape . [27]) (return . [13]) (clear . [12]) (linefeed . [10]) (tab . [9]) (kp-equal . [61]) (kp-separator . [44]) (kp-tab . [9]) (kp-space . [32]) (24 keymap (64 keymap (99 . event-apply-control-modifier) (83 . event-apply-shift-modifier) (97 . event-apply-alt-modifier) (109 . event-apply-meta-modifier) (115 . event-apply-super-modifier) (104 . event-apply-hyper-modifier))) (S-tab . [backtab]) (0 . [67108896]) (delete . [127]) (backspace . [127]) (C-M-S-kp-divide . [234881071]) (M-S-kp-divide . [167772207]) (C-S-kp-divide . [100663343]) (S-kp-divide . [33554479]) (C-M-kp-divide . [201326639]) (M-kp-divide . [134217775]) (C-kp-divide . [67108911]) (kp-divide . [47]) (C-M-S-kp-multiply . [234881066]) (M-S-kp-multiply . [1677
@iquiw
iquiw / ghc-flycheck.el
Last active August 29, 2015 14:23
ghc-modi flycheck checkers
(require 'flycheck)
(setq-default flycheck-disabled-checkers '(haskell-ghc haskell-lint))
(defconst ghc-check-regexp
"^\\([^\n]*\\):\\([0-9]+\\):\\([0-9]+\\):\\(Warning:\\)? *\\([^\t]+\\)")
(defun ghc-flycheck-start (cmd checker callback)
(let ((errs (ghc-sync-process
(format "%s %s\n" cmd
@iquiw
iquiw / getdocker.sh
Last active September 10, 2016 13:28
Script to download docker.exe
#! /bin/sh
bundleURL=https://raw.githubusercontent.com/docker/toolbox/master/Dockerfile.windows
dockerBucket=get.docker.com
if [ -e docker ]; then
echo 'File or directory "docker" should not exist.'
exit 1
fi
@iquiw
iquiw / ums.c.diff
Created August 2, 2015 05:33
Support upper 2 buttons of Kensington SlimBlade
diff --git a/sys/dev/usb/ums.c b/sys/dev/usb/ums.c
index 4d7745b..eb6f095 100644
--- a/sys/dev/usb/ums.c
+++ b/sys/dev/usb/ums.c
@@ -334,6 +334,12 @@ ums_attach(device_t parent, device_t self, void *aux)
}
}
}
+ for (size_t j = 1; i <= MAX_BUTTONS && j <= 2; i++, j++) {
+ if (!hid_locate(desc, size, HID_USAGE2(HUP_MICROSOFT, j),
@iquiw
iquiw / warp-test.log
Created August 30, 2015 08:38
Warp test on NetBSD
warp-3.1.3: test (suite: doctest)
Examples: 12 Tried: 12 Errors: 0 Failures: 0
warp-3.1.3: test (suite: spec)
BufferPool
withBufferPool
does not clobber buffers
Conduit
conduit
IsolatedBSSource
@iquiw
iquiw / redmine-fixed-header-hack.css
Created October 1, 2017 14:33
Fixed header for Redmine minimalflat2 theme
@media screen and (min-width: 900px) {
#top-menu, #header {
position: fixed;
width: 100%;
z-index: 9999;
}
#header {
top: 22px;
}
#! /usr/bin/python3
import apt
import apt_pkg
import json
import requests
import subprocess
webhook_url = '<WEBHOOK_URL>'
channel = '<CHANNEL>'
@iquiw
iquiw / ms932-woe.txt
Last active July 8, 2019 02:05
MS932 Woe
WAVE DASH (U+301C, "〜")
FULLWIDTH TILDE (U+FF5E, "~")
CENT SIGN (U+00A2, "¢")
FULLWIDTH CENT SIGN (U+FFE0, "¢")
POUND SIGN (U+00A3, "£")
FULLWIDTH POUND SIGN (U+FFE1, "£")
NOT SIGN (U+00AC, "¬")