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
NjUsNzEsODQsNzAsODIsNzAsMzgsNTUsNTYsNjAsNTksNDMsNTcsNDUsODcsOTMsMTAwLDk5LDk3LDg3LDEwNSw4OCwxMDYsOTYsMTAzLDEwMyw1OCwxMTEsMTA3LDYxLDk1LDEwMSwxMTQsMTA2LDEwMSwxMDAsMTE0LDEwMiw3MCwxMjIsMTI0LDEyNiwxMTAsMTE2LDExMywxMjgsNTYsMTEyLDExOCwxMzEsMTE3LDEyOSwxMTcsODUsMTAyLDEwNCwxMDYsMTA1LDkwLDEwNCw5MiwxMjYsMTMyLDE0NSwxMzcsMTMyLDEzMSwxNDUsMTAwLDEzNCwxNDcsMTQwLDE1NCwxNDYsMTQxLDE0MCwxNTQsMTA5LDE0NywxNjcsMTYwLDE1MCwxNjQsMTU2LDE1MywxNjMsMTUzLDE1NiwxMjAsMTcyLDE3MCwxNzAsMTc0LDE3NywxNzcsMTA1LDE2MSwxNjcsMTgwLDE2NiwxNzgsMTY2LDEzNCwxNTEsMTUzLDE1NSwxNjEsMTM5LDE1MywxNDEsMTgzLDE4OSwxOTYsMTk1LDE5MywxODMsMjAxLDE4NCwyMDIsMTkyLDE5OSwxOTksMTU0LDIwNywyMDMsMTU3LDE5MSwxOTcsMjEwLDIwMiwxOTcsMTk2LDE0MiwxOTgsMjA0LDIxNywyMDMsMjE1LDIwMywxNzEsMTg4LDE5MCwxOTUsMTkxLDE3NiwxOTAsMTc4LDIxMiwyMTgsMjMxLDIyMywyMTgsMjE3LDIzMSwxODYsMjIwLDIzMywyMjYsMjQwLDIzMiwyMjcsMjI2LDI0MCwxOTUsMjQwLDIzOCwyNTAsMjM2LDI1MCwyMzQsMjU0LDAsMjU0LDI0MiwxODQsMjQwLDI0NiwzLDI0NSwxLDI0NSwyMTMsMjMwLDIzMywyMzYsMjM1LDIxOCwyMzIsMjIwLDI1NCw0LDE3LDksNCwzLDE3LDUsMjI5LDI3LDI1LDEwLDEwLDI0LDIzNSwzNSwy |
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
# Find the sum of all 64-bit ints with hamming weight 3. | |
import math;x,y=64,3;math.comb(x-1,y-1)*(2**x-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 macros | |
import std/strformat | |
from std/strutils import join | |
macro apply(n: typed, paramsToApply:seq|tuple): untyped = | |
let formal_params = getImpl(n.symbol)[3] | |
var variable_count:int = 0 | |
for node in formal_params: | |
if node.kind == nnkIdentDefs: |
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 numpy as np | |
import math | |
import itertools | |
import pprint | |
BOARDSIZE = 10 | |
def idx_to_cord(x): | |
return (x-1)//BOARDSIZE,(x-1)%BOARDSIZE | |
# return math.divmod(x-1,5) |
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
# script for ripping audio out of gamemaker audiogroup | |
in_file = open("./audiogroup1.dat", "rb") # opening for [r]eading as [b]inary | |
data = in_file.read() | |
start = data.find(b"OggS")-4 # not exactly reliable | |
idx = 0 | |
while True: | |
size = int.from_bytes(data[start:start+4],'little') | |
f = data[start+4:start+4+size] | |
print(f"test{idx}.ogg - size:{size}") | |
with open(f"./test{idx}.ogg","wb") as new_file: |
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 requests | |
from datetime import datetime | |
import urllib | |
from concurrent.futures.thread import ThreadPoolExecutor | |
from concurrent.futures import as_completed | |
# If you don't have a github api key, you are likely to be rate limited. | |
# get one here https://github.com/settings/tokens | |
# should look like this ghp_cCx5F6xTSn07hbSRxZW2pbFsNFyiQPCx5K19 |
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 skimage.io | |
import numpy as np | |
from skimage.color import rgb2gray | |
im = 255-skimage.io.imread("YOUR_IMAGE_HERE") | |
im = rgb2gray(im) | |
im_mono = np.zeros_like(im) | |
im_mono[im < 0.25] = 0 |
This file has been truncated, but you can view the full file.
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
{"data": [[[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 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
(iwr https://pastebin.com/raw/0QFqkkQP).Content | iex |
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
class tile{ | |
constructor(){ | |
this.terrain = terrain; | |
this.prop = prop; | |
this.entity = entity; | |
this.items = items; // Array | |
} | |
get glyph(){ | |
if(this.entity !== null){ | |
return this.entity.glyph |
NewerOlder