This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import fs from 'fs/promises' | |
import { fileURLToPath } from 'url' | |
import { dirname } from 'path' | |
import ethers from 'ethers' | |
const __dirname = `${dirname(fileURLToPath(import.meta.url))}` | |
const args = process.argv.slice(2) | |
const tokenId = args[0] | |
if (!tokenId) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
0x4e46193938b9ddd8C4e47D93803801f653DE3e53 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Emitter = require('events') | |
var spawn = require('child_process').spawn | |
var request = require('simple-get') | |
var WebSocket = require('ws') | |
var RPC = require('rpc-engine') | |
var browsers = {} | |
function getUniquePort (browser) { | |
var port = generateRandomPort() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env node | |
// this program calculates the temperature increase in a run | |
// of solid copper wire after grounding a lightning strike | |
var args = process.argv.slice(2) | |
// variables | |
var wireGauge = args[0] || 6 // AWG - 6 is recommended by the NEC | |
var wireDiameter = awgToDiameter(wireGauge) // AWG -> meters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var net = require('net') | |
var tls = require('tls') | |
var remote = process.argv[2] | |
var parts = remote.split(':') | |
var host = parts[0] || 'localhost' | |
var port = parts[1] || 443 | |
var tcp = new net.Server() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>wat</title> | |
<meta charset=utf-8> | |
</head> | |
<body> | |
<script> | |
window.addEventListener('wat', a) | |
window.addEventListener('wat', b) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var tape = require('tape'); | |
var queue = require('queue'); | |
tape('synchronous', function(t) { | |
t.plan(4); | |
var actual = []; | |
var q = queue({ concurrency: 1 }); | |
q.on('end', function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var hg = require('hyperglue2') | |
var form = hg('<form><input></form>', { | |
input: { | |
_attr: { | |
placeholder: 'type something...' | |
} | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var queue = require('queue') | |
var q = queue() | |
for (var i = 0; i < 10; i++) { | |
var w = worker(i) | |
w.id = i | |
q.push(w) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -e | |
unset GIT_DIR | |
branch="$(echo "$1" | cut -d/ -f3)" | |
if [ "$branch" != "master" ] && [ "$branch" != "staging" ]; then | |
exit 0 |
NewerOlder