Skip to content

Instantly share code, notes, and snippets.

@pluswave
pluswave / etherscan-api-demo.js
Last active Apr 13, 2018
etherscan api demo from nodejs
View etherscan-api-demo.js
var api = require('etherscan-api').init('REPLACE THIS WITH YOUR API KEY @ ETHERSCAN', 'ropsten', '3000');
var address = 'RELPACE THIS WITH ADDRESS YOU ARE INTREST';
var balance = api.account.balance(address);
balance.then(function (balanceData) {
//b = JSON.parse(balanceData);
console.log(balanceData);
});
@pluswave
pluswave / Dockerfile
Created May 12, 2017
Set bash for default shell in Debian without user interacting
View Dockerfile
FROM debian:stretch
LABEL reference="https://superuser.com/questions/715722/how-to-do-dpkg-reconfigure-dash-as-bash-automatically"
RUN echo "dash dash/sh boolean false" | debconf-set-selections
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash
View gist:8fd10bbd3b627a8d1fbd07090f4d591b
Verifying that "pluswave.id" is my Blockstack ID. https://onename.com/pluswave
@pluswave
pluswave / rename.js
Created Dec 17, 2016
重命名一组视频文件,去掉前面重复的头,中文序号变为标准3个阿拉伯数字序号
View rename.js
var chnNumChar = {
:0,
:1,
:2,
:3,
:4,
:5,
:6,
:7,
:8,
@pluswave
pluswave / tplink-redial.js
Last active Sep 24, 2016
使用Phontamjs (2.1)模拟,让TPLINK路由器(WVR458G)重新拨号
View tplink-redial.js
@pluswave
pluswave / ecg_chart.py
Last active Jul 16, 2018
基于matplotlib输出心电图纸到pdf文件
View ecg_chart.py
#*-- coding: utf-8 --*
import matplotlib
X_INCH = 7
Y_INCH = 11
X_MM = int(X_INCH*25.4)
Y_MM = int(Y_INCH*25.4)
while X_MM % 5 != 1:
@pluswave
pluswave / youban_mp3_tangshi.js
Created Mar 29, 2016
youban.com 专用MP3爬虫
View youban_mp3_tangshi.js
#!usr/bin/env node
var jsdom = require('jsdom');
function lists(window){
var as = window.document.body.querySelectorAll("#topicListern a");
as = Array.prototype.slice.call(as, 0);
// console.log(JSON.stringify(as));
@pluswave
pluswave / update-plugin.js
Last active Sep 21, 2015
why not ionic plugin update ? so my own solution here.
View update-plugin.js
#!/usr/bin/env node
var fs = require('fs');
var child_process = require('child_process');
if( process.argv.length != 3 ){
console.log("usage: " + process.argv[1] + " packagename");
process.exit(1);
}
@pluswave
pluswave / KitKatPrinter.java
Last active Aug 29, 2015
KItKatPrinter plugin for cordova
View KitKatPrinter.java
package org.xiaofuxing.name;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CallbackContext;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.lang.Runnable;
import android.print.PrintJob;
@pluswave
pluswave / test.xhtml
Created Aug 1, 2014
not work on chromium, but works on firefox (however, keyCode is wrong)
View test.xhtml
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>DocumentKeyTest</title>
<script>
function load(){