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
#!/usr/bin/env bash | |
# https://mmazzarolo.com/blog/2021-08-12-building-an-electron-application-using-create-react-app/ | |
set -ex | |
if [ $# != 1 ] | |
then | |
echo "Usage: $0 <path>" >&2 | |
exit 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 lz4.block | |
f = open('lz4_Block_format.md', 'rb').read() | |
e = lz4.block.compress(f, compression=12, store_size=False) | |
d = [0] * len(f) | |
i = k = 0 | |
while i < len(e): | |
def get_len(l): |
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
# Hacky script because I can't be arsed with both CF's bullshit | |
# Instructions: | |
# - Download modpack from CurseForge's website | |
# - Unzip | |
# - Run this script in the unzipped folder (manifest.json and modlist.html should be present) | |
# - Copy mods/ (& overrides/ maybe) folder wherever | |
import json, os, cloudscraper |
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] | |
name = "hello_world" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies.procfs] | |
version = "0.13" |
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
#!/usr/bin/env python3 | |
from http.server import HTTPServer, BaseHTTPRequestHandler | |
import magic, os | |
class MediaHandler(BaseHTTPRequestHandler): | |
def do_GET(self): | |
if '..' in self.path: | |
self.send_response(403) | |
self.end_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
let weights = [0,1,2, 3,4,5, 6,7]; | |
let centerWidth = 0; | |
let left = -1; | |
let right = 1; | |
//if (Math.min(scanArray.slice(8-centerWidth,9+centerWidth)) > 15) { | |
if (scanArray[8] > 15 && Math.min(scanArray[7],scanArray[9],) > 10) { | |
return 0; | |
} |
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
#!/usr/bin/env bash | |
for file in `find . -name '*.md'`; do | |
output=${file::-3}.html | |
if [[ `date -r "$file" "+%s"` -le `date -r "../$output" "+%s"` ]] | |
then | |
echo "Skipping $file" | |
continue | |
fi | |
mkdir -p ../$(dirname $output) |
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
una_ops = { | |
'not': 0b0001, | |
'inv': 0b0010, | |
'sll': 0b0011, | |
'srl': 0b0100, | |
'sla': 0b0101, | |
'sra': 0b0110, | |
'cp' : 0b0110, | |
} |
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
module BinTree where | |
data BinTree k v = BinTree { key :: k | |
, value :: v | |
, left :: Maybe (BinTree k v) | |
, right :: Maybe (BinTree k v) } | |
deriving (Show) | |
insert :: (Ord k) => k -> v -> Maybe (BinTree k v) -> Maybe (BinTree k v) | |
insert k' v' Nothing = Just $ BinTree k' v' Nothing Nothing |
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
#!/usr/bin/env python3 | |
TEST_ELEM_COUNT = 20 | |
TEST_FAILED_FILE = 'rbtest_failed.txt' | |
import random, sys, traceback, ast | |
import rb # Pas aan indien nodig |
NewerOlder