Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

David C kccheung

🎯
Focusing
View GitHub Profile
@kccheung
kccheung / autossh-jump-rtunnel.service
Created Oct 25, 2019 — forked from ntrepid8/autossh-jump-rtunnel.service
AutoSSH reverse tunnel service config for systemd
View autossh-jump-rtunnel.service
[Unit]
Description=AutoSSH reverse tunnel service for jump.you.io 100022 -> 22
After=network.target
[Service]
Environment="AUTOSSH_GATETIME=0"
ExecStart=/usr/bin/autossh -M 0 -o "ExitOnForwardFailure=yes" -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3" -NR 10022:127.0.0.1:22 user@jump.you.io -i /home/root/.ssh/id_rsa
[Install]
WantedBy=multi-user.target
View pybybit.py
import hashlib
import hmac
import json
import time
import urllib.parse
from threading import Thread
from collections import deque
from requests import Request, Session
from requests.exceptions import HTTPError
@kccheung
kccheung / fork-helper.py
Created May 11, 2018 — forked from ottosch/fork-helper.py
A script to help using ymgve's bitcoin_fork_claimer script
View fork-helper.py
#!/usr/bin/env python
# This script is meant to be used with bitcoin_fork_claimer: https://github.com/ymgve/bitcoin_fork_claimer
# The outputs of this script are the inputs to that script.
# Python 2.x is required
import urllib2
import json
import sys
@kccheung
kccheung / pyscript.py
Created Apr 30, 2018 — forked from n8henrie/pyscript.py
Python script template
View pyscript.py
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""pyscript.py
A simple python script template.
http://ajminich.com/2013/08/01/10-things-i-wish-every-python-script-did/
"""
import argparse
@kccheung
kccheung / .vimrc
Last active Jul 10, 2017 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
View .vimrc
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
View gist:74ff6d287ee6a32677b188fda593eac0
ACTION = build
AD_HOC_CODE_SIGNING_ALLOWED = NO
ALTERNATE_GROUP = staff
ALTERNATE_MODE = u+w,go-w,a+rX
ALTERNATE_OWNER = grantdavis
ALWAYS_SEARCH_USER_PATHS = NO
ALWAYS_USE_SEPARATE_HEADERMAPS = YES
APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer
APPLE_INTERNAL_DIR = /AppleInternal
APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation
View replace_node_modules_gradle_versions.sh
#!/usr/bin/env bash
targetVersion="$1"
if [ "$1" == "" ]; then
echo "Usage: $0 <buildToolsVersion>";
else
find \
node_modules \
-type f \
-iname 'build.gradle' \
@kccheung
kccheung / INSTRUCTIONS_MOBX.md
Last active Mar 12, 2017 — forked from darklight721/INSTRUCTIONS.md
Using MobX with decorators in React Native
View INSTRUCTIONS_MOBX.md

Using MobX with decorators in React Native

The following instructions should work with React Native v0.32:

  1. Install mobx libraries.

    npm install mobx --save
    npm install mobx-react --save
View http_table.md
http lib connect timeout (ms) read timeout write timeout concurrency
OkHttp, retrofit, picasso 10,000 10,000 10,000 64 total, 5 per host
Volley 2,500 2,500 2,500 4
HttpUrlConnection up to few minutes up to few minutes n/a 5
@kccheung
kccheung / SingletonDefaultExportInstance.js
Created Jan 27, 2017 — forked from dmnsgn/SingletonDefaultExportInstance.js
ES6 singleton pattern: module default exports an instance
View SingletonDefaultExportInstance.js
class SingletonDefaultExportInstance {
constructor() {
this._type = 'SingletonDefaultExportInstance';
}
singletonMethod() {
return 'singletonMethod';
}
static staticMethod() {
You can’t perform that action at this time.