Skip to content

Instantly share code, notes, and snippets.

View firedfox's full-sized avatar
🎯
Focusing

Daniel Wang firedfox

🎯
Focusing
  • Weimob
  • Shanghai, China
  • 19:30 (UTC +08:00)
View GitHub Profile
@firedfox
firedfox / web3-test.js
Last active October 8, 2021 11:32
web3 test
const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161');
const myWalletAddress = '0x8bD4DD33e7a479409d8bb8c1eA33BCf6f5625391';
const artBlocksBroker = {
address: '0xE52A2A7B8dACe2ff8cdC64EabB605821A393474D',
abi: [{"inputs":[{"internalType":"address","name":"_profitReceiver","type":"address"},{"internalType":"uint256","name":"_artBlocksBrokerFeeBips","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"_user","type":"address"},{"indexed":true,"internalType":"uint256","name":"_artBlocksProjectId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_priceInWeiEach","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"_quantity","type":"uint256"},{"indexed":false,"internalType":"string","name":"_action","type":"string"},{"indexed":false,"internalType":"uint256","name":"_optionalTokenId","type":"uint256"}],"name":"Action"
@firedfox
firedfox / getUUID.js
Created July 11, 2018 06:10
generate UUID
/**
* 获取一个随机的uint8
*
* @return {number} 随机数
*/
const getRandomUint8 = () =>
(typeof crypto !== 'undefined' && crypto.getRandomValues
? crypto.getRandomValues(new Uint8Array(1))[0]
: Math.floor(Math.random() * 0xff));
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>demo</title>
</head>
<body>
<h3>用户的输入</h3>
<form id="demo-form">
<label>姓名 <input name="name" type="text"></label>
@firedfox
firedfox / git-change-author.sh
Created May 10, 2018 13:10
修改git提交记录中的用户名和邮箱
#!/bin/bash
git filter-branch --env-filter '
WRONG_NAME="your wrong name"
WRONG_EMAIL="your wrong email"
NEW_NAME="your new name"
NEW_EMAIL="your new email"
if [ "$GIT_COMMITTER_NAME" = "$WRONG_NAME" -o "$GIT_COMMITTER_EMAIL" = "$WRONG_EMAIL" ]
then
@firedfox
firedfox / webpack.config.js
Created April 28, 2018 02:48
webpack config
/**
* @file webpack配置文件
* @author wangyang02
*/
const webpack = require('webpack');
module.exports = {
entry: __dirname + '/src/index.js',
output: {
/**
* @file rollup配置文件
* @author wangyang02
*/
import babel from 'rollup-plugin-babel';
export default [{
input: 'src/index.js',
plugins: [
const http = require('http');
const PORT = 3000;
const server = http.createServer((req, res) => {
if (req.method !== 'POST') {
return res.end('');
}
console.log('\nheader:');
(function(d, w) {
var gid = "_uuid_im_3019_";
function $isdone() {
var e = d.getElementById(gid);
if (e) {
return true
}
return false
}
@firedfox
firedfox / ga.js
Created June 28, 2016 10:16
ga.js v4.9.1
/**
* 代码翻译:周培公
* 电子邮件:[email protected]
* 腾讯微博:http://t.qq.com/lanxmail
* 新浪微博:http://weibo.com/1766654653
* 个人主页:http://hi.baidu.com/lanxmail
* 代码地址:http://www.google-analytics.com/ga.js
* 文档地址:http://code.google.com/intl/zh-CN/apis/analytics/
* @fileoverview Google Analytics(分析)客户端javascript代码。
*/
@firedfox
firedfox / markdown-template.html
Last active June 16, 2016 10:40
styles and syntax highlighting for markdown converted by multimarkdown and etc.
<link rel="stylesheet" href="https://assets-cdn.github.com/assets/frameworks-5fa9151252f4560e323d564c56b7bbcdd2cb3c9c1b91b2ba2a4f32442817566f.css">
<style> body { padding: 0 30px; } </style>
<div class="markdown-body">
## Markdown Here
</div>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/highlight.js/latest/styles/default.min.css">
<script src="https://cdn.jsdelivr.net/highlight.js/latest/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>