Skip to content

Instantly share code, notes, and snippets.

@torinkwok
torinkwok / cask_upgrade.sh
Created July 1, 2020 05:10
Bash script to upgrade Homebrew Cask
#!/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`

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 July 5, 2019 06:22
Retrieve data for doing cancer calling evaluation using synthetic dataset 3
#!/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 April 6, 2020 07:47
Yet another implementation for the HACK Assembler outlined in NAND2Tetris
#!/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];
@torinkwok
torinkwok / handy_operators.swift
Last active February 19, 2017 12:25
Handy Operators
import Foundation
// MAKR: =~
protocol RegularExpressionMatchable {
func match( pattern: String, options: NSRegularExpression.Options ) throws -> Bool
}
extension String: RegularExpressionMatchable {
/// Conformance to <RegularExpressionMatchable> protocol
;;; 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"))
;;; 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: ()
;;; 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 July 19, 2016 10:27
Emacs: linum extension to highlight the current line number.
;; 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

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: