Skip to content

Instantly share code, notes, and snippets.

View kim-nguyenkhn's full-sized avatar
🍕

Kim H. Nguyen kim-nguyenkhn

🍕
View GitHub Profile
@kim-nguyenkhn
kim-nguyenkhn / clean-docker.sh
Created February 12, 2022 05:06 — forked from buckett/clean-docker.sh
Cleans out old docker images and containers.
#!/bin/bash
# Clean all exited containers
docker ps -qaf status=exited | xargs docker rm
# Remove all unused images
docker images -f dangling=true -q | xargs docker rmi
@kim-nguyenkhn
kim-nguyenkhn / 01 iTunesSong.scpt
Created February 7, 2022 20:00 — forked from noopkat/01 iTunesSong.scpt
Live Stream 'Now Playing' live text label
on is_running(appName)
tell application "System Events" to (name of processes) contains appName
end is_running
set iTunesRunning to is_running("iTunes")
set noMusic to "no music is playing"
set song to noMusic
if iTunesRunning then
set song to run script "tell application \"iTunes\" to if player state is playing then \"now playing: \" & name of current track & \" by \" & artist of current track"

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

@kim-nguyenkhn
kim-nguyenkhn / difference.js
Created October 4, 2019 21:01 — forked from Yimiprod/difference.js
Deep diff between two object, using lodash
/**
* Deep diff between two object, using lodash
* @param {Object} object Object compared
* @param {Object} base Object to compare with
* @return {Object} Return a new object who represent the diff
*/
function difference(object, base) {
function changes(object, base) {
return _.transform(object, function(result, value, key) {
if (!_.isEqual(value, base[key])) {