Skip to content

Instantly share code, notes, and snippets.

View miao1007's full-sized avatar
🖥️
Free at night on work day.

みゃお miao1007

🖥️
Free at night on work day.
  • Huawei Technologies Co., Ltd.
  • ShenZhen, China
View GitHub Profile
@miao1007
miao1007 / CMakeLists.txt
Created May 6, 2017 16:03
CMakeLists for Jamvm on Clion, no more red symbol
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
@miao1007
miao1007 / system_profiler.sh
Last active July 28, 2021 11:03
Get current mac AC Charger power by command line
# 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
@miao1007
miao1007 / modified_date.js
Created June 26, 2022 15:33
Hexo use modified date from git commit log
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;
});