Install dependencies
npm install levelup leveldown encoding-down @pcan/leveldb-viewer
(Or using the package.json here just npm install
)
Node the web UI server
Install dependencies
npm install levelup leveldown encoding-down @pcan/leveldb-viewer
(Or using the package.json here just npm install
)
Node the web UI server
const AWS = require('aws-sdk') | |
const s3 = new AWS.S3() | |
// Migration in bucket | |
// SOURCE_BUCKET=... node s3-shard-migration.js | |
// Migration from one source bucket to a target bucket | |
// SOURCE_BUCKET=... TARGET_BUCKET=... node s3-shard-migration.js | |
// TODO consider retry/backoff/connect config again |
let string = "wgmi".to_string(); | |
println!("{:?}", string); | |
let bytes: Bytes = string.into(); | |
println!("{}", String::from_utf8(Vec::from(bytes.as_ref())).unwrap()); |
const https = require('https') | |
async function main() { | |
const embeds = [ | |
{ | |
title: 'Test Title', | |
description: 'This is a test description.', | |
color: 16776960, | |
fields: [ | |
{ |
export async function getSolcVersion(filePath: string): Promise<string> { | |
const rl = readline.createInterface({ | |
input: fs.createReadStream(filePath), | |
crlfDelay: Infinity | |
}); | |
let versionFound = false; | |
for await (const line of rl) { | |
if (line.startsWith('pragma')) { | |
versionFound = true; |
const { imageHash } = require('image-hash') | |
const image_url = 'https://media-exp1.licdn.com/dms/image/C4E03AQHTR_sKct2nmQ/profile-displayphoto-shrink_400_400/0/1594060729957?e=1613606400&v=beta&t=qVd6Yatw3WjkiVeo9ouKnC8h2lLbefQm6HROcxYE4Yc' | |
const bits = 16 // the more bits, the more unique the hash | |
const precise = true | |
async function main() { | |
const prom = new Promise((resolve, reject) => { | |
imageHash(image_url, bits, precise, (error, data) => { | |
if (error) reject(error) |
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>ANSIBlackColor</key> | |
<data> | |
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS | |
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NPECow | |
LjA5ODAzOTIxNTY5IDAuMDk4MDM5MjE1NjkgMC4wOTgwMzkyMTU2OQAQAoAC0hAREhNa | |
JGNsYXNzbmFtZVgkY2xhc3Nlc1dOU0NvbG9yohIUWE5TT2JqZWN0XxAPTlNLZXllZEFy |
// This is not clean and some of it needs to be deleted but hey, it works! | |
import React from "react"; | |
import Box from "3box"; | |
import Web3 from "web3"; | |
function Test3Box() { | |
const [connectedToMM, setConnectedToMM] = React.useState(false); | |
const [account, setAccount] = React.useState(""); | |
const [web3, setWeb3] = React.useState(null); |
{ | |
"trailingComma": "es5", | |
"tabWidth": 2, | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": false, | |
"bracketSpacing": true, | |
"arrowParens": "always", | |
"endOfLine": "lf" | |
} |
#!/usr/bin/env python | |
# WS server example | |
# https://websockets.readthedocs.io/en/stable/intro.html | |
""" | |
`pip install websockets` then run as a script | |
""" | |
import asyncio |