Skip to content

Instantly share code, notes, and snippets.

@rainyear
rainyear / bubbles.m
Created December 14, 2013 12:12
Generate the diagnostic and antidiagnostic faces, the same process used in the experimental part that located the bubbles at '1' positions, at each SF band.
load allResults.mat
ySize = 256;
xSize = 256;
imSubSample=0;
nBands = 6; % number of bandpass (cannot be changed at the moment)
fGauss=mkGaussian(11);
fGauss1=fGauss(:,1);
hdiutil convert -format UDRW -o ~/path/to/target.img ~/path/to/ubuntu.iso
diskutil list
diskutil unmountDisk /dev/disk$N
sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m
diskutil eject /dev/disk$N
body {
font-family: Georgia,"Times New Roman",Times,"Kai","Kaiti SC","KaiTi","BiauKai","楷体","楷体_GB2312",serif;
font-size: 18px;
width: 50%;
line-height: 25px;
background: #bdc3c7;
color: #2c3e50;
}
@rainyear
rainyear / .XXXrc
Last active December 25, 2015 11:39
config *rc
.screenrc
----
startup_message off
hardstatus on
hardstatus alwayslastline
hardstatus string "%{.bW}%-w%{.rY}%n %t%{-}%+w %=%{..G} %H(%l) %{..Y} %Y/%m/%d %c:%s "
====
.inputrc
----
@rainyear
rainyear / pythonHeader
Created August 26, 2013 08:25
python script header
#!/usr/bin/env python
#-*- coding:utf-8 -*-
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
#import requests as req
#import re
@rainyear
rainyear / Renamee
Last active December 20, 2015 14:59
Rename literature files.
#!/bin/bash
## 重命名规则
# 1. 长于3个字母的单词首字母大写,短连接线前后大写;
# 2. 只允许出现[空格、短线|单词、数字],点号只允许出现在后缀名之前;
# 3. 单词与数字、数字与数字之间以短线相连。
if [ $# != 1 ] || [ ! -f "$1" ];then
echo Input file-name error!
@rainyear
rainyear / diag
Created July 15, 2013 08:50
usb-debug xiaomi with eclipse
*#*#717717#*#*
@rainyear
rainyear / root_android.sh
Last active December 19, 2015 08:19
root android emulator 4.2.2
cd adt-X/sdk/platform-tools/
./adb shell
mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
cd /system/bin
# try
cat sh > su
#!/usr/bin/python
from distutils.sysconfig import get_python_lib
print get_python_lib()
@rainyear
rainyear / x.sublime-build
Last active December 18, 2015 21:29
compile & run scripts in sublime text.
//Java.sublime-build
{
"cmd": ["javac", "$file"],
"selector": "source.java",
"encoding": "cp936",
"variants":
[{
"name": "Run",
"cmd": ["java", "$file_base_name"]
}]