Skip to content

Instantly share code, notes, and snippets.

View yingca1's full-sized avatar
🎯
Focusing

Ying yingca1

🎯
Focusing
  • London, UK
  • 02:23 (UTC +01:00)
View GitHub Profile
@yingca1
yingca1 / find
Last active August 29, 2015 13:57
mac osx search and replace text
find . -type f -name '*.txt' -exec sed -i '' s/this/that/ {} +
find . -name "*.java" -exec sed -i "" 's/com.xxx.R/android.R/g' {} \;
grep -nr "@+id" *
find . -name "*.java" | xargs sed -i 's/com.xxx.R/android.R/g'
find . -name "*.xml" | xargs grep -i -n "@id/" >> output.txt
@yingca1
yingca1 / repo
Last active August 29, 2015 14:03
repo command line notes
repo forall -c 'git reset --hard ; git clean -fdx'
@yingca1
yingca1 / rsync
Created July 11, 2014 02:07
sync two folder files
rsync -abP folder1/src/ folder2/src
@yingca1
yingca1 / linux
Last active August 29, 2015 14:03
#查看系统信息
cat /etc/issue cat /proc/verison
top – 进程活动
vmstat -系统活动、硬件及系统信息
w – 显示谁已登录,他们正在做什么?
uptime – 告诉系统已经运行了多久?
@yingca1
yingca1 / wifi
Created July 11, 2014 03:40
windows wifi hotpsot setup
netsh wlan set hostednetwork mode=allow ssid="wifi hotspot name" key="wifi password"
netsh wlan start hostednetwork
@yingca1
yingca1 / logcat
Created July 11, 2014 12:23
logcat some common usage
adb logcat -b main -b radio -b events -v time>test.log
@yingca1
yingca1 / macos
Last active August 29, 2015 14:04
mac command lines
mac 硬盘测速
time dd if=/dev/zero bs=1024k of=tstfile count=1024
time dd if=tstfile bs=1024k of=/dev/null count=1024
显示:defaults write com.apple.finder AppleShowAllFiles -bool true
隐藏:defaults write com.apple.finder AppleShowAllFiles -bool false
@yingca1
yingca1 / colors.xml
Created September 23, 2014 03:31
android
<?xml version="1.0" encoding="utf-8" ?>
<resources>
<color name="white">#FFFFFF</color><!--白色 -->
<color name="ivory">#FFFFF0</color><!--象牙色 -->
<color name="lightyellow">#FFFFE0</color><!--亮黄色 -->
<color name="yellow">#FFFF00</color><!--黄色 -->
<color name="snow">#FFFAFA</color><!--雪白色 -->
<color name="floralwhite">#FFFAF0</color><!--花白色 -->
<color name="lemonchiffon">#FFFACD</color><!--柠檬绸色 -->
<color name="cornsilk">#FFF8DC</color><!--米绸色 -->
@yingca1
yingca1 / android
Last active August 29, 2015 14:06
# 批量装文件夹下apk
for f in *.apk ; do adb install -r $f; done;
import urllib.request
import asyncio
import json
r = urllib.request.urlopen('https://raw.githubusercontent.com/spacelan/wechat-emoticon/master/emoticons.json').read().decode('utf8')
json_obj = json.loads(r)
@asyncio.coroutine
def download(todo):
urllib.request.urlretrieve(todo.get('url'), todo.get('md5') + '.gif')