Skip to content

Instantly share code, notes, and snippets.

Avatar
🥝
The best editor is neither Emacs nor Vim, it's whiteboard.

Torin Tung Kwok torinkwok

🥝
The best editor is neither Emacs nor Vim, it's whiteboard.
View GitHub Profile
@torinkwok
torinkwok / cask_upgrade.sh
Created Jul 1, 2020
Bash script to upgrade Homebrew Cask
View cask_upgrade.sh
#!/usr/bin/env bash
(set -x; brew update;)
(set -x; brew cleanup;)
(set -x; brew cask cleanup;)
red=`tput setaf 1`
green=`tput setaf 2`
reset=`tput sgr0`
View keybase.md

Keybase proof

I hereby claim:

  • I am torinkwok on github.
  • I am kwok (https://keybase.io/kwok) on keybase.
  • I have a public key whose fingerprint is E390 E410 27E8 FFA5 F9E2 CD9E 5883 C992 27F5 A05E

To claim this, I am signing this object:

@torinkwok
torinkwok / cancer-dream-syn3-getdata.sh
Last active Jul 5, 2019
Retrieve data for doing cancer calling evaluation using synthetic dataset 3
View cancer-dream-syn3-getdata.sh
#!/bin/bash
set -eu -o pipefail
# Retrieve data for doing cancer calling evaluation using synthetic dataset 3
# from the ICGC-TCGA DREAM challenge:
# https://www.synapse.org/#!Synapse:syn312572/wiki/62018
# ==============================
# Exome only data
@torinkwok
torinkwok / hasm
Last active Apr 6, 2020
Yet another implementation for the HACK Assembler outlined in NAND2Tetris
View hasm
#!/usr/bin/env perl
use Modern::Perl;
use File::Temp;
use Const::Fast;
use experimental qw( switch );
die "An input file is expected" if not defined $ARGV[0];
die "An output must be specified" if not defined $ARGV[1];
View handy_operators.swift
import Foundation
// MAKR: =~
protocol RegularExpressionMatchable {
func match( pattern: String, options: NSRegularExpression.Options ) throws -> Bool
}
extension String: RegularExpressionMatchable {
/// Conformance to <RegularExpressionMatchable> protocol
View crosshairs.el
;;; crosshairs.el --- Highlight the current line and column.
;;
;; Filename: crosshairs.el
;; Description: Highlight the current line and column.
;; Author: Drew Adams
;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
;; Copyright (C) 2006-2016, Drew Adams, all rights reserved.
;; Created: Fri Sep 08 13:09:19 2006
;; Version: 0
;; Package-Requires: ((hl-line+ "0") (col-highlight "0") (vline "0"))
View hl-line+.el
;;; hl-line+.el --- Extensions to hl-line.el.
;;
;; Filename: hl-line+.el
;; Description: Extensions to hl-line.el.
;; Author: Drew Adams
;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
;; Copyright (C) 2006-2016, Drew Adams, all rights reserved.
;; Created: Sat Aug 26 18:17:18 2006
;; Version: 0
;; Package-Requires: ()
View hl-spotlight.el
;;; hl-spotlight.el --- Extension of hl-line.el to spotlight current few lines.
;;
;; Filename: hl-spotlight.el
;; Description: Extension of hl-line.el to spotlight current few lines.
;; Author: Drew Adams
;; Maintainer: Drew Adams (concat "drew.adams" "@" "oracle" ".com")
;; Copyright (C) 2009-2016, Drew Adams, all rights reserved.
;; Created: Sat Aug 26 18:17:18 2006
;; Version: 0
;; Package-Requires: ()
@torinkwok
torinkwok / linum-highligth-current-line-number.el
Created Jul 19, 2016
Emacs: linum extension to highlight the current line number.
View linum-highligth-current-line-number.el
;; Copyright (C) 2014 Emanuele Tomasi <targzeta@gmail.com>
;; This program is free software: you can redistribute it and/or modify
;; it under the terms of the GNU General Public License as published by
;; the Free Software Foundation, either version 3 of the License, or
;; (at your option) any later version.
;;
;; This program is distributed in the hope that it will be useful,
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
View keybase.md

Keybase proof

I hereby claim:

  • I am TorinKwok on github.
  • I am kwok (https://keybase.io/kwok) on keybase.
  • I have a public key whose fingerprint is 47F6 EDAE 759B 0E81 F42A A9F2 FD3E ED91 66AC 41DB

To claim this, I am signing this object: