Skip to content

Instantly share code, notes, and snippets.

View allada's full-sized avatar

Nathan (Blaise) Bruer allada

View GitHub Profile
fatal error: concurrent map read and map write
goroutine 2197 [running]:
runtime.throw(0x15a54b3, 0x21)
runtime/panic.go:774 +0x54 fp=0x402ffd01e0 sp=0x402ffd01b0 pc=0x446d3c
runtime.mapaccess2(0x1326760, 0x402933c960, 0x402ffd02f0, 0x282d140, 0x40ba090d00)
runtime/map.go:470 +0x258 fp=0x402ffd0230 sp=0x402ffd01e0 pc=0x4259f0
github.com/ethereum/go-ethereum/trie.(*Database).commit(0x402feba000, 0x69ac0cabd078f198, 0xa9374ccefdd64cf4, 0x68d95ec392b54be3, 0x291993f7f835a42b, 0x1abb260, 0x420b665400, 0x0, 0x0, 0xa04ac27bb3efc701, ...)
github.com/ethereum/go-ethereum@/trie/database.go:790 +0x64 fp=0x402ffd03d0 sp=0x402ffd0230 pc=0x74e01c
github.com/ethereum/go-ethereum/trie.(*Database).commit.func1(0x69ac0cabd078f198, 0xa9374ccefdd64cf4, 0x68d95ec392b54be3, 0x291993f7f835a42b)
@allada
allada / proxy.js
Created June 18, 2021 07:53
Proof
const ethers = require('ethers');
const WebSocket = require('ws');
const endPoints = [
'ws://127.0.0.1:49011',
'ws://127.0.0.1:49012',
'ws://127.0.0.1:49013',
'ws://127.0.0.1:49014',
'ws://127.0.0.1:49015',
'ws://127.0.0.1:49016',
@allada
allada / getStatus.js
Last active November 15, 2023 06:33
const ethers = require('ethers');
const process = require('process');
// Delay to wait to calculate blocks per second in seconds.
const delay = 60 * 60;
// To run:
// node getStatus.js /path/to/bsc/node/geth.ipc
async function run() {
const path = process.argv[2];
@allada
allada / ipv6.cc
Last active November 7, 2016 01:55
#include <string>
int base16Pows[] = {
0x1,
0x10,
0x100,
0x1000,
0x10000
};
function extract(data) {
var findTestFunction = /(\s*function\s+)test\s*\(([^)]*)\)(\s*{?)/;
data = data.replace(findTestFunction, "$1innerTest($2)\$3");
var findBody = /<body(?:\s+[^>]*)?>([\s\S]*)<\/body>/;
body = data.match(findBody)[1];
var findScriptsFunction = /<script\s+.*src="([^"]+)"/g
var match;
var scripts = [];
while (match = findScriptsFunction.exec(data)) {
scripts.push(match[1]);
package main
import (
"net/http"
"io"
"time"
"golang.org/x/net/websocket"
"golang.org/x/net/http2"
)
<!-- images are determined by width and height. The following are supported -->
<splash src="res/screen/ios/Default~iphone.png" width="320" height="480"/>
<splash src="res/screen/ios/Default@2x~iphone.png" width="640" height="960"/>
<splash src="res/screen/ios/Default-Portrait~ipad.png" width="768" height="1024"/>
<splash src="res/screen/ios/Default-Portrait@2x~ipad.png" width="1536" height="2048"/>
<splash src="res/screen/ios/Default-Landscape~ipad.png" width="1024" height="768"/>
<splash src="res/screen/ios/Default-Landscape@2x~ipad.png" width="2048" height="1536"/>
<splash src="res/screen/ios/Default-568h@2x~iphone.png" width="640" height="1136"/>
<splash src="res/screen/ios/Default-667h.png" width="750" height="1334"/>
<splash src="res/screen/ios/Default-736h.png" width="1242" height="2208"/>
This file has been truncated, but you can view the full file.
*M-UNKNOWN MEXICAN TRUCKING COMPANY
8CON CONTSHIP CONTAINER LINE
99M UNKNOWN MEXICAN OVERLAND CARRIER
AAAB AAA MOTORS
AAAC AAACTION TRANSPORTATION INC
AAAD A A A DELIVERY INC
AAAG ATC LOGISTICS INC
AAAO AAMODT INC
AAAU ASIA CONTAINER LEASING CO LTD
AAAW AAA WALKER TRANSPORTATION SERVICES
<?php
class Model{
private static $hookInstalls = array();
public function addHook($hookName, $id, Closure $closure){
// Code to add closure to static::$hookInstalls
}
public $id;
// Updates when record is updated
public function update(){
if(($r = static::runHooks('beforeUpdate', $this)) !== null){
<?php
function findset($s, $l){
$len = count($s);
$outAry = array();
$ptrs = array();
for($i=0;$i<$l;$i++){
$ptrs[] = $i;
}
$i=0;
$curPtr = $l-1;