Skip to content

Instantly share code, notes, and snippets.

View tonyxu-io's full-sized avatar
😀
Busy?

Tony Xu tonyxu-io

😀
Busy?
View GitHub Profile
@tonyxu-io
tonyxu-io / _tree.js
Last active June 25, 2018 03:18
Tree #DataStructureAlgorithms
// Tree Node Definition
function TreeNode(val) {
this.val = val;
this.left = this.right = null;
}
// Tree Creation
var t = new TreeNode(10)
t.left = new TreeNode(-2)
t.right = new TreeNode(6)
@tonyxu-io
tonyxu-io / merge-sort-array.js
Last active June 25, 2018 03:18
Array #DataStructureAlgorithms
// Merge two arrays
function merge(arr1, arr2) {
var res = []
while (arr1.length > 0 && arr2.length > 0) {
if (arr1[0] < arr2[0]) {
res.push(arr1.shift())
} else {
res.push(arr2.shift())
}
}
@tonyxu-io
tonyxu-io / git-reset-author.sh
Last active February 19, 2020 06:00 — forked from bgromov/git-reset-author.sh
Git Commands
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD
@tonyxu-io
tonyxu-io / shadowsocksr-install.md
Last active January 4, 2024 05:31
ShadowsocksR 一键安装

ShadowsocksR 一键安装

适配环境: CentOS 6

安装

yum install wget
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh
chmod +x shadowsocksR.sh
@tonyxu-io
tonyxu-io / Tony Xu Terminal Profile.terminal
Created July 10, 2020 21:29
Tony Xu's profile for Terminal.app
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlueColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGBwpYJHZlcnNpb25ZJGFyY2hpdmVyVCR0b3BYJG9iamVjdHMS
AAGGoF8QD05TS2V5ZWRBcmNoaXZlctEICVRyb290gAGjCwwTVSRudWxs0w0ODxARElVO
U1JHQlxOU0NvbG9yU3BhY2VWJGNsYXNzTxAmMC43NDExNzY0ODYgMC41NzY0NzA2MTM1
IDAuOTc2NDcwNTg5NgAQAYAC0hQVFhdaJGNsYXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9y
@tonyxu-io
tonyxu-io / exiftool-commands.md
Last active September 7, 2023 02:33
Exiftool Commands

Exiftool Commands

Copy photos to date folders

Sony:

exiftool -o . '-Directory<CreateDate' -d /Volumes/home/Photos/Original/Sony\ Camera/%Y-%m-%d -r /Volumes/Untitled/DCIM -progress
@tonyxu-io
tonyxu-io / edge-lite.mobileconfig
Last active February 11, 2023 22:51
Edge Lite by Tony
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadDisplayName</key>
<string>Edge Lite (Tony Xu)</string>
<key>PayloadIdentifier</key>
<string>io.tonyxu.edge-lite</string>
<key>PayloadType</key>
<string>Configuration</string>
@tonyxu-io
tonyxu-io / TonyXu-iTerm2.json
Last active February 25, 2023 18:22
iTerm2 Profile - Tony Xu
{
"Ansi 6 Color" : {
"Green Component" : 0.9137254901960784,
"Red Component" : 0.54509803921568623,
"Blue Component" : 0.99215686274509807
},
"Tags" : [
],
"Ansi 12 Color" : {
@tonyxu-io
tonyxu-io / edge-lite.mobileconfig
Last active April 28, 2024 17:05
Edge Configuration Profile
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PayloadDisplayName</key>
<string>tony-edge-lite</string>
<key>PayloadIdentifier</key>
<string>io.tonyxu.edge-lite</string>
<key>PayloadType</key>
<string>Configuration</string>