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
// Execute this normally in a browsers debug console. | |
const ws = new WebSocket('ws://127.0.0.1:8080/'); | |
ws.onopen = async () => { | |
// Send different 1mb arrays. | |
for (let i = 0; i < 10; i++) { | |
const data = new Uint8Array(1024 * 1024); | |
for (let j = 0; j < 1024 * 1024; j++) { | |
data[j] = i; |
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
// The columns that will contain opinions (emoji). | |
const opinionColumns = [16, 17, 18, 19, 20]; | |
// The columns to change the colour of. | |
const toColourColumns = [15, 16, 17, 18, 19, 20]; | |
// The weights given to each individual opinion. | |
const opinionWeights = { | |
"😍": 6, | |
"👍": 3, |
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
package main | |
import ( | |
"bufio" | |
"fmt" | |
"net" | |
"os/exec" | |
"runtime" | |
"strings" | |
) |
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
(^|.*\.)(deliveroo)\..*$ | |
(^|.*\.)(je-apis|je-apps|just-eat|just-eat-prod-.*)\..*$ | |
(^|.*\.)(uber|ubereats)\..*$ |
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 discord | |
DISCORD_TOKEN = "" | |
class testClient(discord.Client): | |
def __init__(self, *args, **kwargs): | |
super().__init__(*args, **kwargs) | |
async def on_ready(self): |
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
from PIL import ImageGrab | |
import numpy as np | |
import pyautogui | |
from time import sleep | |
coords = [181, 348, 778, 765] # Game window coords | |
againCoords = [505, 732] # "Again" button coords | |
# Game window h/w | |
imageWidth = 597 |
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
from tkinter import Tk, filedialog | |
import os | |
Tk().withdraw() | |
directory = filedialog.askdirectory() | |
filenames = os.listdir(directory) | |
for count, filename in enumerate(filenames): | |
file_extension = os.path.splitext(filename)[1] | |
print(filename + " -> " + str(count+1)+file_extension) |
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 websocket | |
from json import loads as tojson | |
def on_message(ws, raw_message): | |
print("\nGot raw_message") | |
message = tojson(raw_message) | |
invalue = int(message["x"]["inputs"][0]["prev_out"]["value"]) / 100000000 | |
outvalue = int(message["x"]["out"][0]["value"]) / 100000000 | |
print("BTC in :", invalue) | |
print("BTC out:", outvalue) # Actual confirmed transaction |
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
from mido import MidiFile | |
from time import sleep | |
import pygame, sys | |
count = 0 | |
playback_gui = " "*10 | |
print("Press CTRL+C to quit") | |
if len(sys.argv) < 2: | |
mid_file = input(".mid file path: ") | |
else: | |
mid_file = " ".join(sys.argv[1:]) |
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 socket | |
import sys | |
host = input("Host >> ") | |
port = int(input("Port >> ")) | |
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
try: | |
s.connect((host, port)) | |
except OSError: |
NewerOlder