start new:
tmux
start new with session name:
tmux new -s myname
#! /bin/sh | |
function normalize { | |
local rc=0 | |
local ret | |
if [ $# -gt 0 ] ; then | |
# invalid | |
if [ "x`echo $1 | grep -E '^/\.\.'`" != "x" ] ; then | |
echo $1 |
#! /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)\ | |
}\ |
{"lastUpload":"2020-06-20T09:41:02.337Z","extensionVersion":"v3.4.3"} |
#! /usr/bin/env node | |
const io = require('socket.io-client') | |
const { | |
host = 'http://localhost', | |
port = 80, | |
password, | |
nsp = '/apollon', | |
room = 'default' |
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) { |
#! /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 |
#! /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 |
cp -R /Applications/Utilities/Terminal.app/Contents/Resources/Fonts/. /Library/Fonts/ |
#! /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 |