This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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>KeepAlive</key> | |
<dict> | |
<key>SuccessfulExit</key> | |
<false/> | |
</dict> | |
<key>Label</key> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class uf { | |
public: | |
uf (int n) : arr(n, -1), nc(0) {} | |
void un (int i, int j) { | |
int ci = find(i); | |
if (ci == -1) { | |
ci = arr[i] = i; | |
nc++; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
function kube { | |
kubectl --kubeconfig=$HOME/Dropbox/wansong.kubeconfig -n c-dev "$@" | |
} | |
pat=$1 | |
lines=$(kube get po | grep -E "$pat") | |
IFSBack=$IFS |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp -R /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/. /Library/Fonts/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
the_list='' | |
all_deps=`npm list --depth 0 2>/dev/null | awk '{ print $2 }' | sed -E 's/(.+)@[^@]+/\1/'` | |
function has_package { | |
for ddd in $all_deps ; do | |
if [ "$ddd" = "$1" ] ; then | |
return 0 | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
sum=0 | |
cnt=0 | |
last_avg=0 | |
while read -s num ; do | |
if ! echo "$num" | grep -E '^[0-9]+$' >/dev/null ; then | |
continue | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function maxSubArray(arr) { | |
let cur_max = arr[0]; | |
let max = cur_max; | |
let maxi = 0; | |
let maxj = 0; | |
let curj = 0; | |
for (let i = 1; i < arr.length; i++) { | |
const v = arr[i]; | |
if (cur_max < 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env node | |
const io = require('socket.io-client') | |
const { | |
host = 'http://localhost', | |
port = 80, | |
password, | |
nsp = '/apollon', | |
room = 'default' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2020-06-20T09:41:02.337Z","extensionVersion":"v3.4.3"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
sed -i.bak -E '/doFirst/i\ | |
\ \ \ \ doLast {\ | |
\ \ \ \ def moveFunc = { resSuffix ->\ | |
\ \ \ \ File originalDir = file("${resourcesDir}/drawable-${resSuffix}")\ | |
\ \ \ \ if (originalDir.exists()) {\ | |
File destDir = file("${resourcesDir}/drawable-${resSuffix}-v4")\ | |
ant.move(file: originalDir, tofile: destDir)\ | |
}\ |