Skip to content

Instantly share code, notes, and snippets.

View longbill's full-sized avatar
🏠
Working from home

Chunlong longbill

🏠
Working from home
View GitHub Profile
@nevergiveup-j
nevergiveup-j / onerror
Last active June 12, 2018 06:09
前端代码异常日志收集与监控
/**
* @param {String} msg 错误信息
* @param {String} url 出错的文件
* @param {Long} line 出错代码的行号
* @param {Long} col 出错代码的列号
* @param {Object} error 错误的详细信息,Anything
*/
window.onerror = function(msg,url,line,col,error){
//没有URL不上报!上报也不知道错误
if (msg != "Script error." && !url){
@RFV
RFV / Gambling.sol
Created December 20, 2016 22:02
Solidity Gambling Smart Contract
contract Gamble {
function Gamble() {
owner = msg.sender;
address nameReg = 0x72ba7d8e73fe8eb666ea66babc8116a41bfb10e2;
nameReg.callstring32string32("register", "UltimateGamble");
}
function gamble(uint luckyNumber) {
value = value+ msg.value;
hash randomness = sha3(block.prevhash ^ hash(msg.sender) ^ luckyNumber);
@RGBKnights
RGBKnights / test-academy.js
Last active April 30, 2020 17:12
ReImproveJS
import assert from 'assert'
import { NeuralNetwork, Model, Academy } from "reimprovejs/dist/reimprove.js"
const TIMEOUT = 1; // mins
const MAP_SIZE = 10;
function randomPoint()
{
let min = 0;
let max = MAP_SIZE;