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 machine | |
import time | |
import utime | |
class Nunchuk(object): | |
"""The Nunchuk object presents the sensor readings in a polling way. | |
Based on the fact that the controller does communicate using I2C we | |
cannot make it push sensor changes by using interrupts or similar | |
facilities. Instead a polling mechanism is implemented, which updates | |
the sensor readings based on "intent-driven" regular updates. |
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 asyncio | |
import websockets | |
from http.server import HTTPServer, SimpleHTTPRequestHandler | |
from socketserver import ThreadingMixIn | |
myip = b'127.0.0.1' | |
def replace_localhost(data): | |
return data.replace(b'localhost', myip) |
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
// MAIN FUNCTION | |
// This function will scrape all the conversations from the chatorg website | |
// It will return an array of arrays, the outer array is of all conversation | |
// the inner array is a list of message pairs | |
// grab all anchors | |
// advance to the next anchor | |
// pull the current chat history | |
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 asyncio | |
from fastapi import FastAPI, WebSocket | |
from fastapi.responses import FileResponse | |
from fastapi.staticfiles import StaticFiles | |
import os | |
import websockets | |
app = FastAPI() | |
# Mount the static files in the storage/node_modules/gun directory under the /gun path |
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
input | |
.split('\n') | |
.map((e, i, a) => i && a[i] - a[i - 1]) | |
.filter(n => n > 0) | |
.length | |
// 1527 | |
// create a new array, then scan the input, adding each element to its coresponding index and the next two indexes as well | |
// is the number of additions any different than looking ahead and behind for each of them? | |
// for 1st strategy, for each element, I read 3 and write once. |
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
Windows Registry Editor Version 5.00 | |
; credit to https://superuser.com/questions/949385/map-capslock-to-control-in-windows-10 | |
; The hex data is in five groups of four bytes: | |
; 00,00,00,00,\ header version (always 00000000) | |
; 00,00,00,00,\ header flags (always 00000000) | |
; 04,00,00,00,\ # of entries (3 in this case) plus a NULL terminator line. | |
; Entries are in 2-byte pairs: Key code to send & keyboard key to send it. | |
; Each entry is in "least significant byte, most significant byte" order, | |
; e.g. 0x1234 becomes `34,12` | |
; 1d,00,3a,00,\ Send LEFT CTRL (0x001d) code when user presses the CAPS LOCK key (0x003a) |
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
function printOurSailor(allPublicKeys, candidatesSeed){ | |
for(var candidateSeed of candidatesSeed){ | |
let keychain = this.CryptoService.mnemonicToKeychain(candidateSeed) | |
let seedHex = this.CryptoService.keychainToSeedHex(keychain) | |
let privateKey = this.CryptoService.seedHexToPrivateKey(seedHex) | |
let publicKey = this.CryptoService.privateKeyToBitcloutPublicKey(privateKey, "mainnet") | |
if(allPublicKeys.has(publicKey)){ | |
console.log("Our sailor is" + publicKey + " mnemonic: " + candidateSeed) | |
} | |
} |
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
bamboo | |
banana | |
banner | |
barely | |
barrel | |
basket | |
battle | |
cactus | |
camera | |
cancel |
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
# based on https://gist.github.com/jhass/652dd780d23c1e236ff913e8a2b77eb2 | |
# http://jsbin.com/wonitaqode/edit?js,output | |
# mitmproxy -s cors.py | |
# mitmdump -s cors.py | |
from mitmproxy import http | |
def response(flow): | |
h = flow.request.headers |
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
{ | |
"ProfilesFound": [ | |
{ | |
"PublicKeyBase58Check": "BC1YLi6LpXTemAG8T9ptyWAkMywrjynwZcKjB5DkDXxrsG5kgAwAqxq", | |
"Username": "maebeam", | |
"Description": "buidling bitclout", | |
"ProfilePic": "data:image/jpeg;base64,/9j/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDIBCQkJDAsMGA0NGDIhHCEyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMv/AABEIAGQAZAMBIgACEQEDEQH/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAAIBAwMCBAMFBQQEAAABfQECAwAEEQUSITFBBhNRYQcicRQygZGhCCNCscEVUtHwJDNicoIJChYXGBkaJSYnKCkqNDU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6g4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2drh4uPk5ebn6Onq8fLz9PX29/j5+gEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoLEQACAQIEBAMEBwUEBAABAncAAQIDEQQFITEGEkFRB2FxEyIygQgUQpGhscEJIzNS8BVictEKFiQ04SXxFxgZGiYnKCkqNTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqCg4SFhoeIiYqSk5SVlpeYmZqio6Slpqeoqaqys7S1tre4ubrCw8TFxsfIycrS09TV1tfY2dri4+Tl5ufo6ery8/T19vf4+fr/2gAMAwEAAhEDEQA/APTqSlq |
NewerOlder