Skip to content

Instantly share code, notes, and snippets.

View johnteee's full-sized avatar

John Lee johnteee

  • Taipei
View GitHub Profile
@johnteee
johnteee / android_instructions.md
Created June 6, 2024 05:19 — forked from patrickhammond/android_instructions.md
Easily setup an Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@johnteee
johnteee / aws-ecr-credential.go
Created March 7, 2024 07:52 — forked from zapkub/aws-ecr-credential.go
how to get AWS credential from ECR with golang
/*
* Copyright (c) 2019. Inception Asia
* Maintain by DigithunWorldwide ❤
* Maintainer
* - [email protected]
* - [email protected]
*/
package util
@johnteee
johnteee / regex_useful.md
Created May 18, 2023 05:29 — forked from pyliaorachel/regex_useful.md
Some Regular Expressions that may be useful for data cleaning.
Punctuations, US-ASCII

/[!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]/

Punctuations, include Unicode ones (\u2000-\u206F: general punctuations, \u2E00-\u2E7F: supplemental punctuations)

/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,\-.\/:;<=>?@\[\]^_`{|}~]/

Chinese characters
@johnteee
johnteee / index.php
Created October 12, 2022 04:17 — forked from will83/index.php
PHP function to translate WGS84 to GPS coordinates
<?php
$lat = -24.108764;
$lng = 16.500156;
function WGS84toGPS($lat, $lng){
$lat = number_format($lat, 6);
$lng = number_format($lng, 6);
// define latitude coordinate with minutes and seconds
$lat_card = ($lat > 0) ? 'N' : 'S';
@johnteee
johnteee / 廣韻反切音韻地位表(測試版).csv
Created June 8, 2022 10:06 — forked from ayaka14732/廣韻反切音韻地位表(測試版).csv
《廣韻》(澤存堂本)反切音韻地位表(測試版)
小韻號 小韻首字 上字 下字 被切字音韻描述們 上字音韻描述們 下字音韻描述們
1 端一東平 端開登入 匣一東平
2 定一東平 定模平 匣一東平
3 知三東平 知開蒸入 見三東平
4 澄三東平 澄開蒸入 見三東平
5 章三東平 章開蒸入 日三東平
6 徹三東平 徹開蒸入 知三東平
7 崇三東平 崇魚平 見三東平
8 心三東平 心開蒸入 見三東平
9 日三東平 日魚平 以三東平
@johnteee
johnteee / scratch_server.go
Created August 15, 2021 12:01 — forked from jschaf/scratch_server.go
A Go web server from scratch using syscalls
package main
// Simple, single-threaded server using system calls instead of the net library.
//
// Omitted features from the go net package:
//
// - TLS
// - Most error checking
// - Only supports bodies that close, no persistent or chunked connections
// - Redirects
@johnteee
johnteee / file-upload-multipart.go
Created July 18, 2021 14:26 — forked from andrewmilson/file-upload-multipart.go
Golang multipart/form-data File Upload
package main
import (
"net/http"
"os"
"bytes"
"path"
"path/filepath"
"mime/multipart"
"io"
@johnteee
johnteee / mac-setup-redis.md
Created March 31, 2021 08:55 — forked from tomysmile/mac-setup-redis.md
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
@johnteee
johnteee / walk.go
Created March 17, 2021 05:20 — forked from tdegrunt/walk.go
Replace some text in a bunch of files with golang
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
@johnteee
johnteee / rfc3339.js
Created December 10, 2020 02:07 — forked from pjdietz/rfc3339.js
Format a local date as an RFC 3339 date with timezone
function rfc3339(d) {
function pad(n) {
return n < 10 ? "0" + n : n;
}
function timezoneOffset(offset) {
var sign;
if (offset === 0) {
return "Z";