This file contains hidden or 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
const childProcess = require('child_process'); | |
/** | |
* use `page.modified` in your theme | |
*/ | |
hexo.extend.filter.register('before_post_render', function (data) { | |
data.title = data.title.toLowerCase(); | |
data.modified = git_log(data.full_source) | |
return data; | |
}); |
This file contains hidden or 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
# brew install jq is required | |
system_profiler SPPowerDataType -json | jq '.SPPowerDataType[] | select(._name == "sppower_ac_charger_information").sppower_ac_charger_watts | tonumber' # eg response | |
# response example: 87 |
This file contains hidden or 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
cmake_minimum_required(VERSION 3.4) | |
project(jamvm_2_0_0) | |
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") | |
set(SOURCE_FILES | |
src/arch/arm.h | |
src/arch/i386.h | |
src/arch/mips.h | |
src/arch/parisc.h |
This file contains hidden or 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 com.xxxx.xxxx.xxx.utils; | |
import org.jsoup.Jsoup; | |
import org.jsoup.nodes.Document; | |
import org.jsoup.nodes.Element; | |
import org.jsoup.select.Elements; | |
import java.io.File; | |
import java.util.ArrayList; | |
import java.util.List; |
This file contains hidden or 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 com.github.miao1007.myapplication; | |
import android.annotation.TargetApi; | |
import android.app.Activity; | |
import android.content.Context; | |
import android.graphics.Bitmap; | |
import android.graphics.Canvas; | |
import android.graphics.Color; | |
import android.graphics.drawable.ColorDrawable; | |
import android.os.Build; |
This file contains hidden or 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 | |
#delay 30 minute | |
delay=-v-30M | |
#image location | |
location=$HOME/Pictures/himawari8 | |
date=$(date -u $delay "+%Y/%m/%d") | |
file_name=$(date -u $delay "+%H")$(echo "($(date -u $delay "+%M"))/10 * 10" | bc)"00_0_0.png" | |
url=http://himawari8-dl.nict.go.jp/himawari8/img/D531106/1d/550/$date/$file_name |
This file contains hidden or 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 | |
#install go with brew | |
brew update | |
brew install go | |
#make go dir | |
cd ~ | |
mkdir goroot | |
mkdir gopath |
This file contains hidden or 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
import okio.ByteString; | |
/** | |
* Created by leon on 8/23/15. | |
* 数据传输单元转换封装 | |
*/ | |
public class APDUUtils { | |
/** | |
* Eg: getBitInByte(0x80,7) == true |
This file contains hidden or 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
dependencies { | |
compile 'io.reactivex:rxjava:1.0.12' | |
compile 'com.squareup.okhttp:okhttp:2.5.0' | |
compile 'com.squareup.retrofit:retrofit:2.0.0-beta1' | |
compile 'com.squareup.retrofit:converter-gson:2.0.0-beta1' | |
compile 'com.squareup.retrofit:adapter-rxjava:2.0.0-beta1' | |
} |
This file contains hidden or 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
/** | |
* Created by leon on 2/16/15. | |
* Download update apk with SystemService. | |
* require: <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> | |
*/ | |
public class DownloadUtils { | |
public static String MINETYPE_APPLCATION = "application/vnd.android.package-archive"; | |
public static long DownloadApkWithProgress(Context context, String url) { |
NewerOlder