Skip to content

Instantly share code, notes, and snippets.


Chew Choon Keat choonkeat

View GitHub Profile
choonkeat /
Created May 20, 2022 01:12 — forked from yang-wei/
Elm Destructuring (or Pattern Matching) cheatsheet

Should be work with 0.18

Destructuring(or pattern matching) is a way used to extract data from a data structure(tuple, list, record) that mirros the construction. Compare to other languages, Elm support much less destructuring but let's see what it got !


myTuple = ("A", "B", "C")
myNestedTuple = ("A", "B", "C", ("X", "Y", "Z"))
choonkeat /
Created December 28, 2019 13:04 — forked from dukeofgaming/
Linus google tech talk transcript

This is transcript of Tech Talk: Linus Torvalds on Git at Google on YouTube.


Thank you, for coming everybody, some of you probably already have heard of Linus Torvalds, those of you who haven't, you are the people with Macintoshes on your laps.

View disable mcafee endpoint

method 1

sudo /usr/local/McAfee/AntiMalware/VSControl stopoas


sudo defaults write /Library/Preferences/com.mcafee.ssm.antimalware.plist OAS_Enable -bool False
sudo /usr/local/McAfee/AntiMalware/VSControl stop
sudo /usr/local/McAfee/AntiMalware/VSControl reload
choonkeat / underscore.go
Created February 7, 2018 14:49 — forked from regeda/underscore.go
Convert CamelCase to underscore in golang with UTF-8 support.
View underscore.go
package main
import (
View cruby.txt
Calculating -------------------------------------
@choonkeat 1.000 i/100ms
@sferik 1.000 i/100ms
@choonkeat 0.100 (± 0.0%) i/s - 1.000 in 10.000901s
@sferik 0.099 (± 0.0%) i/s - 1.000 in 10.087707s
@choonkeat: 0.1 i/s
@sferik: 0.1 i/s - 1.01x slower

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF


To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

#!/usr/bin/env python
import binascii, sys, json
from libmproxy import version, tnetstring, flow
from datetime import datetime
def create_har(flows):
return {
choonkeat / zoom.js
Created June 18, 2010 00:15 — forked from mislav/zoom.js
View zoom.js
/* tested on the iPad and iPhone */
function getZoomFactor() {
var deviceWidth, landscape = Math.abs(window.orientation) == 90
// workaround for strange screen.height on the iPhone (v3.1.3)
if (window.screen.width == 320) deviceWidth = landscape ? 480 : 320
else deviceWidth = window.screen[landscape ? "height" : "width"]
return deviceWidth / window.innerWidth