Skip to content

Instantly share code, notes, and snippets.

Dat Nguyen datlife

Block or report user

Report or block datlife

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@datlife
datlife / notes.md
Last active Mar 5, 2019
Setup Apache Spark/ Jupyter Notebook on MacOS
View notes.md
@datlife
datlife / README.md
Last active Sep 10, 2019
Build LLVM / Clang on MacOS
View README.md

Build LLVM / Clang on MacOS

Problem

Built-in Clang / LLVM shipped by Xcode does not support Leak Santizer (-fsantize=leak) feature. For example, this code has memory leak:

// File: main.c

#include <stdlib.h>
@datlife
datlife / async.jsx
Last active May 19, 2019
Event Loop
View async.jsx
// Async should be first priority over callbacks and promises
//
// High level idea:
// - Avoid .then .catch in promise
// - Syntatic sugar to make async programming similar to sequential code
const axios = require('axios');
DEFAULT_URL = "https://jsonplaceholder.typicode.com"
async function getUser(id) {
let resp = await axios.get(`${DEFAULT_URL}/users/${id}`)
@datlife
datlife / fscale.sh
Last active Sep 14, 2019
Fractional Scaling for Ubuntu 18.04
View fscale.sh
#!/bin/bash
# Enable fractional scaling on Ubuntu 18.04
#
# Problem:
# --------
# - Ubuntu 18.04 runs on Gnome 3.28, whichs does not support fractional scaling (120%, 130%).
# - As a result, the text and icon on my 4K 27" monitor are very small.
#
# Usage:
# -------
@datlife
datlife / README.md
Created Oct 7, 2019
Spark on K8s using helm
View README.md

Status: alpha

alias k=kubectl

# Add microsoft charts to heml
helm repo add msftcharts http://microsoft.github.io/charts/repo
helm repo update

# Launch spark cluster with custom config
You can’t perform that action at this time.