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
| /* The world's smallest Brainfuck interpreter in C, by Kang Seonghoon | |
| * http://j.mearie.org/post/1181041789/brainfuck-interpreter-in-2-lines-of-c */ | |
| s[99],*r=s,*d,c;main(a,b){char*v=1[d=b];for(;c=*v++%93;)for(b=c&2,b=c%7?a&&(c&17 | |
| ?c&1?(*r+=b-1):(r+=b-1):syscall(4-!b,b,r,1),0):v;b&&c|a**r;v=d)main(!c,&a);d=v;} |
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
| urlencode() { | |
| # urlencode <string> | |
| old_lc_collate=$LC_COLLATE | |
| LC_COLLATE=C | |
| local length="${#1}" | |
| for (( i = 0; i < length; i++ )); do | |
| local c="${1:$i:1}" | |
| case $c in |
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
| # vim: fileencoding=utf-8 | |
| import time, signal | |
| from tornado import web, ioloop, options, httpserver | |
| _SHUTDOWN_TIMEOUT = 30 | |
| def make_safely_shutdown(server): | |
| io_loop = server.io_loop or ioloop.IOLoop.instance() | |
| def stop_handler(*args, **keywords): | |
| def shutdown(): |
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
| # taken from http://www.piware.de/2011/01/creating-an-https-server-in-python/ | |
| # generate server.xml with the following command: | |
| # openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes | |
| # run as follows: | |
| # python simple-https-server.py | |
| # then in your browser, visit: | |
| # https://localhost:4443 | |
| import BaseHTTPServer, SimpleHTTPServer | |
| import ssl |
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
| /** | |
| * Returns PBKDF2 derived key from supplied password. | |
| * | |
| * Stored key can subsequently be used to verify that a password matches the original password used | |
| * to derive the key, using pbkdf2Verify(). | |
| * | |
| * @param {String} password - Password to be hashed using key derivation function. | |
| * @param {Number} [iterations=1e6] - Number of iterations of HMAC function to apply. | |
| * @returns {String} Derived key as base64 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
| #!/bin/bash | |
| # Copyright (c)2022 https://bookfere.com | |
| # This is a batch script for fixing Google Translate and making it available | |
| # in the Chinese mainland. If you experience any problem, visit the page below: | |
| # https://bookfere.com/post/1020.html | |
| set -e | |
| IPS=( | |
| 74.125.137.90 |
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
| :: Copyright (c)2022 https://bookfere.com | |
| :: This is a batch script for fixing Google Translate and making it available | |
| :: in the Chinese mainland. If you experience any problem, visit the page below: | |
| :: https://bookfere.com/post/1020.html | |
| @echo off | |
| setlocal enabledelayedexpansion | |
| chcp 437 >NUL | |
| set "ips[0]=74.125.137.90" |
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 bun | |
| import { mkdirSync, readFileSync, writeFileSync } from "node:fs"; | |
| import path from "node:path"; | |
| const TRAILER = Buffer.from("\n---- Bun! ----\n"); | |
| const BUN_SECTION_NAME = ".bun"; | |
| const OFFSET_STRUCT_SIZE = 32; | |
| const MODULE_RECORD_SIZE = 52; |