This file contains 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/bash | |
if [ -z "$1" ] | |
then | |
echo "usage: ./urlencode.sh 'hello'" | |
exit 0 | |
fi | |
echo -n $( php -r "echo rawurlencode(\"$1\");"; ) |
This file contains 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
-optimizationpasses 5 # 指定代码的压缩级别 | |
-dontusemixedcaseclassnames # 是否使用大小写混合 | |
-dontskipnonpubliclibraryclasses # 是否混淆第三方jar | |
-dontpreverify # 混淆时是否做预校验 | |
-keepattributes SourceFile,LineNumberTable # 混淆号错误信息里带上代码行 | |
-verbose # 混淆时是否记录日志 | |
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* # 混淆时所采用的算法 | |
-libraryjars libs/android_api.jar | |
-libraryjars libs/baidumapapi_v2_2_0.jar |
This file contains 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
buildscript { | |
repositories { | |
mavenCentral() | |
} | |
dependencies { | |
classpath 'com.android.tools.build:gradle:0.4' | |
} | |
} | |
apply plugin: 'android' |
This file contains 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
[DEFAULT] | |
# A "shared secret" between keystone and other openstack services | |
admin_token = ADMIN | |
# The IP address of the network interface to listen on | |
bind_host = 0.0.0.0 | |
# The port number which the public service listens on | |
public_port = 5000 |
This file contains 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 | |
##echo user nice system idle iowait irq softirq | |
CPULOG_1=$(cat /proc/stat | grep 'cpu ' | awk '{print $2" "$3" "$4" "$5" "$6" "$7" "$8}') | |
SYS_IDLE_1=$(echo $CPULOG_1 | awk '{print $4}') | |
Total_1=$(echo $CPULOG_1 | awk '{print $1+$2+$3+$4+$5+$6+$7}') | |
sleep 5 | |
CPULOG_2=$(cat /proc/stat | grep 'cpu ' | awk '{print $2" "$3" "$4" "$5" "$6" "$7" "$8}') |
This file contains 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
~ ✗ diff -ruN mutex.go mutexv2.go | |
--- mutex.go 2012-10-25 11:30:04.170656858 +0800 | |
+++ mutexv2.go 2012-10-25 11:30:04.174656858 +0800 | |
@@ -9,8 +9,9 @@ | |
) | |
type Msg struct { | |
- mutex sync.Mutex | |
- count map[int64]string | |
+ rmutex sync.RWMutex |
This file contains 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
package main | |
import ( | |
"flag" | |
"fmt" | |
"net" | |
"net/http" | |
"net/http/httputil" | |
"net/url" | |
"time" |
This file contains 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
package main | |
import ( | |
"container/list" | |
"flag" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"log" | |
"net/http" |
This file contains 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
package main | |
import ( | |
"fmt" | |
"syscall" | |
"time" | |
) | |
const ( | |
Megabyte = 1024 * 1024 |
This file contains 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
package main | |
import ( | |
"fmt" | |
"runtime" | |
"sync" | |
"time" | |
) | |
const MAX = 100 |