Skip to content

Instantly share code, notes, and snippets.

View 8enet's full-sized avatar
💭
I may be slow to respond.

zzzmode 8enet

💭
I may be slow to respond.
View GitHub Profile

Ref: https://gist.github.com/vertexclique/9839383

Important Note

Please use built-in Terminal.app (of Mac OS X) to type and rune the command, do not use another tool (like iTerm2).

Common step after enter run the patch command:

  • After run the commands, start new Sublime Text app, go to Main Menu > Help > Enter License. On the popup type in any text (example "a") and click Use Licence .
@8enet
8enet / mysave.gradle
Last active September 14, 2016 06:45
自动保存配置到properties文件中,比如对应版本号的递增,实现每次构建后版本不同
apply plugin:MySavePlugin
class MySavePlugin implements Plugin<Project>{
@Override
void apply(Project project) {
def file=project.rootProject.file("myprop.properties")
project.extensions.create("myprop",InnerStorage,file)
}

使用rxjava递归遍历目录和统计目录所有文件大小

public static Observable<File> getFile(File file){
        if(file.isFile()){
            return Observable.just(file);
        }
        return Observable.from(file.listFiles()).concatMap(new Func1<File, Observable<File>>() {
            @Override
            public Observable<File> call(File file) {
                return getFile(file);
@8enet
8enet / debian7-mongodb
Last active April 8, 2016 18:29
debian8 install virtualbox
https://jira.mongodb.org/browse/SERVER-14786
@8enet
8enet / homebrew.md
Created October 15, 2015 15:16
github contributor guide

更新homebrew中的软件版本

1、fork homebrew
2、git clone https://github.com/{yourname}/homebrew.git
3、如果用网页版编辑可以跳过。修改采用Sublime Text3作为编辑器,export HOMEBREW_EDITOR='/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl'
4、以tomcat为例,brew edit tomcat,一般只需要修改前几行中的url,mirrorsha256urlmirror从发行软件的 页可以看到,其中mirror要是可以直接下载的链接,sha256是下载文件的sha256值,我们可以先下载mirror中的这个文件,然后用shasum -a 256 [/downfile]计算文件的sha256值。 5、

git commit -a -m 'update tomcat {version}' >>git push origin master

#!/bin/bash
mkdir `pwd`/.temp_for_certificate
cd `pwd`/.temp_for_certificate
count=0
while [ -n "$1" ]
do
cd ..
curPath=$1
apply plugin: 'com.android.application'
apply plugin: 'idea'
android {
compileSdkVersion 21
buildToolsVersion "22.0.0"
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7