Skip to content

Instantly share code, notes, and snippets.

View typebrook's full-sized avatar

Hsieh Chin Fan typebrook

View GitHub Profile
miglen /
Created February 10, 2021 11:55
Dirty check for non existing public npm dependencies
#!/bin/env python3
# The following script finds all package.json files in the current dir and checks if there are referenced any
# dependencies that no public package is available for, making your application vulnerable to supply-chain attack.
# Simply run ./ in your root repository direcotory.
import json
import requests
from pathlib import Path
import urllib.parse
Closer2U / _000 Gist
Last active March 4, 2021 01:32
Gist Shortcuts for publishing, previewing etc...
View _000 Gist
View samizdat-shell-help.bash
### my-script — does one thing well
### Usage:
### my-script <input> <output>
### Options:
### <input> Input file to read.
### <output> Output file to write. Use '-' for stdout.
jevakallio /
Last active September 28, 2023 12:37
`adb pull` from app data directory without root access

TL;DR; is your app identifier, and the file path is relative to the app user's home directory, e.g. '/data/user/0/

adb shell run-as cp relative/path/file.ext /sdcard
adb pull /sdcard/file.ext

See long explanation below.

ambientlight /
Last active May 26, 2020 05:02
RFC: Organic backend architecture for offline-first application via logux

RFC: Organic backend architecture for offline-first application via logux


Lay out the base ground-work for distributed backend system architecture designed to support offline usecases that involve synchronization of client application during the events when client applications are offline for a periods that exceed days or weeks. Additionally the architecture is meant to support easy-to-replicate offline servers, which act as ad-hoc (edge) synchronization endpoints that are capable of supporting a full range of available business-specific functionality, thus making clients unaware of unexisting internet connectivity between ad-hoc and cloud-hosted server.


This RFC is not meant to describe any application-specific business logic (another one for this) such as features provided by solution hosted in such backend system, entity-relationship diagrams modeled in DBs etc.


The base area of exploration / experimentation lies around Logux which conceptually can

import freetype
import osmium
import sys
face = freetype.Face("/System/Library/Fonts/STHeiti Medium.ttc")
def check_tags(t,o):
for k,v in o.tags:
if k == 'name':
for char in v:
JoeThunyathep / index.html
Created April 20, 2020 17:28
Index file for Cesium NYC application
View index.html
<html lang="en">
<meta charset="utf-8">
<script src=""></script>
<link href="" rel="stylesheet">
<div id="cesiumContainer" style="width: 100%; height:100%"></div>
var viewer = new Cesium.Viewer('cesiumContainer');
# set -x
if [ -z $1 ] ; then
echo "Usage: $0 url_of_zsync"
exit -1
cd $(dirname $0)
mcdlee / u_and_n.ipynb
Last active June 23, 2020 02:29
Using PyTorch to classify my writing
View u_and_n.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.