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
#include <array> | |
#include <bitset> | |
#include <unordered_map> | |
#include <iostream> | |
#include <vector> | |
// from https://github.com/martinus/unordered_dense | |
// direct link: https://github.com/martinus/unordered_dense/raw/v3.0.2/include/ankerl/unordered_dense.h | |
#include "unordered_dense.h" |
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
; optimized version of https://reddit.com/comments/l4wfoo/_/gkrkhkb/ | |
; usage: | |
; nasm tinysleep.asm | |
; chmod +x tinysleep | |
; ./tinysleep 5 | |
bits 64 | |
db 0x7F, 0x45, 0x4c, 0x46, 0x02, 0x01, 0x01, 0x00 | |
db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
db 0x02, 0x00, 0x3E, 0x00, 0x01, 0x00, 0x00, 0x00 | |
db 0x78, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00 |
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
target = input("Target text: ") | |
total_len, init_seg = input("BFCruch output: ").split(": ") | |
start_pointer, _, path = input().partition(", ") | |
path = eval("["+path+"]") | |
tape_segment = eval("["+input()+"]") | |
tape_offset = min(x[0] for x in path) | |
out = init_seg | |
cur_pos = int(start_pointer) |
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
$#000p#"<>:#,_@#1*66*57::*86**278\-1:*57$p | |
":1: error: declaration expected |
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 math | |
import decimal | |
Dec = decimal.Decimal | |
import functools | |
try: | |
import readline | |
except ImportError: | |
pass |
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 math | |
import functools | |
# Greatest common divisor of more than 2 numbers. Am I terrible for doing it this way? | |
def gcd(*numbers): | |
"""Return the greatest common divisor of the given integers""" | |
return functools.reduce(math.gcd, numbers) | |
# Least common multiple is not in standard libraries? It's in gmpy, but this is simple enough: |
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
68c68 | |
< std::cerr << getMooLine() << std::endl; | |
--- | |
> std::cerr << getMooLine(); // getMooLine already has a newline | |
166c166 | |
< time_t const timenow = time(NULL); | |
--- | |
> struct timespec timenow; | |
168c168,169 | |
< localtime_r(&timenow, &april); |
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
-- a computercraft archive format | |
-- by randomdude999 | |
local function get_rel_path(file, prefix) | |
local file = fs.combine(file,'') -- make path more correct | |
local prefix = fs.combine(prefix, '') | |
return fs.combine(file:gsub(prefix, ''), '') | |
end | |
local function recurseList(start) |
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
#!/usr/bin/env python3 | |
# A command line xkcd client | |
# Requires python and the requests module (available from pip) | |
# simplejson is recommended (from pip), but standard json will do | |
# readline is recommended, but not required | |
# Note: settings are configured for linux, on Windows you might have to change | |
# some settings (lines 48-51) | |
# Copyright © 2016 randomdude999 |