Skip to content

Instantly share code, notes, and snippets.

Mobieus Jay tangingw

Block or report user

Report or block tangingw

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
@tangingw
tangingw / hospital_covid_screening.json
Last active Mar 30, 2020
Public Hospital that conduct Covid-19 Screening (GeoJSON)
View hospital_covid_screening.json
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@tangingw
tangingw / json2yaml.py
Created Mar 28, 2020 — forked from noahcoad/json2yaml.py
Python to convert json to yaml
View json2yaml.py
#!/usr/bin/env python3
# convert json to yaml
# http://pyyaml.org/wiki/PyYAMLDocumentation
# python3 json2yaml.py < ~/code/manpow/moneybug/mbuploader/support/offices.json
# gist https://gist.github.com/noahcoad/46909253a5891af3699580b8f17baba8
import yaml, json, sys
sys.stdout.write(yaml.dump(json.load(sys.stdin)))
View keybase.md

Keybase proof

I hereby claim:

  • I am tangingw on github.
  • I am tangingw (https://keybase.io/tangingw) on keybase.
  • I have a public key whose fingerprint is 4CCD A09D 08D1 D23A 9B55 2D95 87E6 558E 507A A2BE

To claim this, I am signing this object:

@tangingw
tangingw / pip_proxy.py
Created Aug 16, 2019
This is a python script that runs pip in the proxy environments
View pip_proxy.py
import os
import re
import sys
PROXY = "<HTTP URL of YOUR PROXY>"
TRUSTED_URL = [
"pypi.org",
"files.pythonhosted.org",
"pypi.python.org"
@tangingw
tangingw / decorator_learning.py
Last active May 15, 2018
Learning on Python Decorator
View decorator_learning.py
def decorate_msg(func):
def wrapped(*args):
return "the answer is %f" % func(*args)
return wrapped
def filename_decorate(filename):
@tangingw
tangingw / install_ensurepip.py
Created Nov 15, 2017 — forked from uranusjr/install_ensurepip.py
Script to install ensurepip to Python. “Fix” the Ubuntu 14.04 / Debian Sid bug. https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=732703
View install_ensurepip.py
import os
import sys
import io
import tarfile
import urllib.request
ARCHIVE_URL = 'http://d.pr/f/YqS5+'
@tangingw
tangingw / counting.py
Created Jul 20, 2017
Algorithms for a tricky math problems
View counting.py
"""Synosis:
This is the algorithm that address the
following trick math question:
1 + 4 = 5
2 + 5 = 12
3 + 6 = 21
8 + 11 = ?
However this algorithm can also find the solution for such
@tangingw
tangingw / binary_tree_search.go
Last active May 23, 2017
This is a simple implementation of binary tree search algorithm in Golang
View binary_tree_search.go
package main
import (
"fmt"
)
/*
Reference:
1. http://0xax.blogspot.my/2014/08/binary-tree-and-some-generic-tricks.html
2. https://www.tutorialspoint.com/data_structures_algorithms/tree_traversal.htm
@tangingw
tangingw / binary_search.go
Created Mar 3, 2017
This is golang binary search in recursive form
View binary_search.go
package main
//Recursive Binary Search
func binarySearch(numList []int64, key int64) int {
low := 0
high := len(numList) - 1
if low <= high {
@tangingw
tangingw / watch.py
Last active Oct 28, 2016
This is a naughty script that mimics linux watch command on Mac OS X.
View watch.py
import os
import sys
import time
"""This is a naughty script
to mimic linux watch process
in Mac OS X terminal. It might be
useful for other *BSD family.
"""
You can’t perform that action at this time.