Skip to content

Instantly share code, notes, and snippets.

View Matrixbirds's full-sized avatar

matrixbirds Matrixbirds

View GitHub Profile
@Matrixbirds
Matrixbirds / country_code.json
Last active March 6, 2020 07:46
手机号iso-3166+地区码
[{"COUNTRY_CODE":"AC","PHONE_CODE":"247"},{"COUNTRY_CODE":"AD","PHONE_CODE":"376"},{"COUNTRY_CODE":"AE","PHONE_CODE":"971"},{"COUNTRY_CODE":"AF","PHONE_CODE":"93"},{"COUNTRY_CODE":"AG","PHONE_CODE":"1"},{"COUNTRY_CODE":"AI","PHONE_CODE":"1"},{"COUNTRY_CODE":"AL","PHONE_CODE":"355"},{"COUNTRY_CODE":"AM","PHONE_CODE":"374"},{"COUNTRY_CODE":"AO","PHONE_CODE":"244"},{"COUNTRY_CODE":"AR","PHONE_CODE":"54"},{"COUNTRY_CODE":"AS","PHONE_CODE":"1"},{"COUNTRY_CODE":"AT","PHONE_CODE":"43"},{"COUNTRY_CODE":"AU","PHONE_CODE":"61"},{"COUNTRY_CODE":"AW","PHONE_CODE":"297"},{"COUNTRY_CODE":"AX","PHONE_CODE":"358"},{"COUNTRY_CODE":"AZ","PHONE_CODE":"994"},{"COUNTRY_CODE":"BA","PHONE_CODE":"387"},{"COUNTRY_CODE":"BB","PHONE_CODE":"1"},{"COUNTRY_CODE":"BD","PHONE_CODE":"880"},{"COUNTRY_CODE":"BE","PHONE_CODE":"32"},{"COUNTRY_CODE":"BF","PHONE_CODE":"226"},{"COUNTRY_CODE":"BG","PHONE_CODE":"359"},{"COUNTRY_CODE":"BH","PHONE_CODE":"973"},{"COUNTRY_CODE":"BI","PHONE_CODE":"257"},{"COUNTRY_CODE":"BJ","PHONE_CODE":"229"},{"COUNTRY_C
@Matrixbirds
Matrixbirds / parcel bundle
Created January 15, 2020 03:59
work scripts
parcel bundle available js file
```javascript
parcel bundle lib/index.js --global FastPng
```
@Matrixbirds
Matrixbirds / scripts
Last active October 17, 2019 04:07
git bare repo simple solution
.git/hooks/post-receive
#!/bin/bash
WORK_TREE="../"
git --work-tree="${WORK_TREE}" reset --hard
git bare repos doesn't contain the work tree.
@Matrixbirds
Matrixbirds / apkanalyzer-usage.sh
Last active August 9, 2019 07:08
react-native
# 分析客户提供的apk
# 检查apk里是否包含bundlejs的文件
apkanalyzer files list app/build/outputs/apk/release/app-release.apk | grep bundle
# 检查apk里包含的so库
apkanalyzer files list app/build/outputs/apk/release/app-release.apk | grep lib
# 列出apk里的全部文件
apkanalyzer files list app/build/outputs/apk/release/app-release.apk
@Matrixbirds
Matrixbirds / christmas_tree.cxx
Last active December 24, 2018 15:51
Merry-Christmas.cxx
# include <iostream>
using namespace std;
/********* Merry Christmas :P *******/
int
main(){
int a
;
cin
@Matrixbirds
Matrixbirds / AI.js
Created December 14, 2018 03:17
No License No Limit Anybody can use it
#!/usr/bin/env node
require('readline').createInterface({input: process.stdin,output: process.stdout}).on('line', (answer) => console.log("葬爱家族村口王师傅: ", answer.replace(/吗?\?$/g, '!')))
@Matrixbirds
Matrixbirds / CMakeLists.txt
Last active November 23, 2018 08:07
cmake example
cmake_minimum_required (VERSION 3.12.4) #
project (dns-server) # project name
set(CMAKE_C_COMPILER g++) # set c++ compiler
add_compile_options(-std=c++11) # set c++11 standard
include_directories(${LINK_DIR}) # include path
link_directories(${LINK_DIR}) # link path
link_libraries(ev) # link libs
add_executable(app-name main.cpp) # entry point
target_link_libraries(app-name ev) # link xx
@Matrixbirds
Matrixbirds / deploy.sh
Last active September 6, 2018 06:55
部署etc geth
# 创建docker volume 并且挂载到/opt/docker/volumes/etc
docker create --name etc --device=/opt/docker/volumes/etc --opt o=bind
# docker pull images
# 启动测试节点
docker run -d --name etc-geth -v docker_tmp:/tmp -v ethereumclassic:/root/.ethereum-classic -p 30303:30303 -p 8080:8080 -p 8180:8180 -p 8545:8545 ethereumclassic/etc-geth:latest geth --rpc --chain=morden --rpcapi "db,eth,net,web3,personal,admin,miner" --rpccorsdomain "*" --network-id=62 --autodag --etherbase 0xE14940F809Df48E865bac1102f52B4D01aBe1bCB --rpcport 8545 --rpcaddr 0.0.0.0 --mine --minerthreads 1 --targetgaslimit 90000
8c0fa801d1a0787f3390c47011e5f93ed487576eeaad53d8ccd09a9439508226
@Matrixbirds
Matrixbirds / mac-os.sh
Created May 17, 2018 02:50
常用命令curl & pretty print json
brew install jsonpp
curl -XPOST URI.json | jsonpp
@Matrixbirds
Matrixbirds / run.sh
Last active May 18, 2018 02:34
安装脚本
sudo apt install autoconf bison build-essential libssl-dev libyaml-dev \
libreadline-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm-dev git -y
vim ~/.bashrc
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build