This file contains hidden or 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 std/[times, math, strformat] | |
const | |
SIZE = 50_000_000 | |
proc initSeqs(): (seq[float32], seq[float32], seq[float32]) = | |
var A = newSeq[float32](SIZE) | |
var B = newSeq[float32](SIZE) | |
var D = newSeq[float32](SIZE) | |
for i in 0..<SIZE: |
This file contains hidden or 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 tables, strutils, os | |
type | |
TinyDB* = object | |
filename: string | |
data: Table[string, string] | |
proc init*(filename: string): TinyDB = | |
result.filename = filename | |
result.data = initTable[string, string]() |
This file contains hidden or 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 requests | |
import re | |
import binascii | |
import hashlib | |
def get_salt(ip): | |
response = requests.get(f"http://{ip}/cgi/getParm", headers={"Referer": f"http://{ip}/"}) | |
match = re.search(r'var ss="([^"]+)"', response.text) | |
return match.group(1) |
This file contains hidden or 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 random, raylib | |
randomize() | |
type | |
Unit = object | |
pos: Vector2 | |
hp: int | |
let size = rand(5..22) |
This file contains hidden or 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
-- mod-version:3 | |
local core = require "core" | |
local common = require "core.common" | |
local config = require "core.config" | |
local DocView = require "core.docview" | |
local command = require "core.command" | |
local keymap = require "core.keymap" | |
local www = require "libraries.www" | |
local json = require "libraries.dkjson" |
This file contains hidden or 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 os | |
const defaultFontsDirectories = | |
when defined(android): | |
["/system/fonts"] | |
elif defined(macosx): | |
[ | |
"/Library/Fonts/", | |
"/System/Library/Fonts/", | |
"/Network/Library/Fonts/", |
This file contains hidden or 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, _thread | |
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) | |
server_address = '0.0.0.0' | |
server_port = 31337 | |
sock_addr = socket.getaddrinfo(server_address, server_port)[0][-1] | |
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) | |
sock.bind(sock_addr) |
This file contains hidden or 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 binascii, socket, ssl, _thread, hashlib | |
certkey = binascii.unhexlify(b"3082013b020100024100cc20643fd3d9c21a0acba4f48f61aadd675f52175a9dcf07fbef610a6a6ba14abb891745cd18a1d4c056580d8ff1a639460f867013c8391cdc9f2e573b0f872d0203010001024100bb17a54aeb3dd7ae4edec05e775ca9632cf02d29c2a089b563b0d05cdf95aeca507de674553f28b4eadaca82d5549a86058f9996b07768686a5b02cb240dd9f1022100f4a63f5549e817547dca97b5c658038e8593cb78c5aba3c4642cc4cd031d868f022100d598d870ffe4a34df8de57047a50b97b71f4d23e323f527837c9edae88c7948302210098560c89a70385c36eb07fd7083235c4c1184e525d838aedf7128958bedfdbb1022051c0dab7057a8176ca966f3feb81123d4974a733df0f958525f547dfd1c271f90220446c2cafad455a671a8cf398e642e1be3b18a3d3aec2e67a9478f83c964c4f1f") | |
cert = binascii.unhexlify(b"308201d53082017f020203e8300d06092a864886f70d01010505003075310b30090603550406130258583114301206035504080c0b54686550726f76696e63653110300e06035504070c075468654369747931133011060355040a0c0a436f6d70616e7958595a31133011060355040b0c0a436f6d70616e7958595a3114301206035504030c0b546865 |
This file contains hidden or 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 binascii, socket, _thread, hashlib | |
class WebSocketServer: | |
def __init__(self, host='0.0.0.0', port=8443, on_connect=None, on_disconnect=None, on_message=None): | |
self.host = host | |
self.port = port | |
self.clients = [] | |
self.on_connect = on_connect | |
self.on_disconnect = on_disconnect | |
self.on_message = on_message |
This file contains hidden or 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/sh | |
# Create a png with a false thumbnail; | |
# looks different when you view it full res. | |
high="$1" # High image (full-size original view) | |
low="$2" # Low image (thumbnail) (should be the same size) | |
output="output.png" | |
[ ! -z "$3" ] && output="$3" # Output image |
NewerOlder