Skip to content

Instantly share code, notes, and snippets.

@pluswave
pluswave / etherscan-api-demo.js
Last active April 13, 2018 07:26
etherscan api demo from nodejs
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 06:39
Set bash for default shell in Debian without user interacting
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
Verifying that "pluswave.id" is my Blockstack ID. https://onename.com/pluswave
@pluswave
pluswave / rename.js
Created December 17, 2016 14:14
重命名一组视频文件,去掉前面重复的头,中文序号变为标准3个阿拉伯数字序号
var chnNumChar = {
零:0,
一:1,
二:2,
三:3,
四:4,
五:5,
六:6,
七:7,
八:8,
@pluswave
pluswave / tplink-redial.js
Last active September 24, 2016 06:31
使用Phontamjs (2.1)模拟,让TPLINK路由器(WVR458G)重新拨号
@pluswave
pluswave / ecg_chart.py
Last active July 16, 2018 01:32
基于matplotlib输出心电图纸到pdf文件
#*-- 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 March 29, 2016 13:30
youban.com 专用MP3爬虫
#!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 September 21, 2015 10:11
why not ionic plugin update ? so my own solution here.
#!/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 August 29, 2015 14:05
KItKatPrinter plugin for cordova
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 August 1, 2014 10:36
not work on chromium, but works on firefox (however, keyCode is wrong)
<?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(){