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
[http "https://github.com"] | |
proxy = http://127.0.0.1:10800 | |
[https "https://github.com"] | |
proxy = http://127.0.0.1:10800 |
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
<input id="input" type="file" onchange="handle()" /> | |
<script> | |
let a | |
const handle = () => { | |
let e = document.getElementById('input') | |
let f = e.files[0] | |
setInterval(() => { | |
// console.log(f) | |
// No mem usage increament | |
// At least in Chrome, Blob is automatically put on memory or disk |
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 | |
set -euo pipefail | |
# From https://www.v2ex.com/t/811424 | |
function __curl() { | |
read proto server path <<<$(echo ${1//// }) | |
DOC=/${path// //} | |
HOST=${server//:*} | |
PORT=${server//*:} |
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
using System; | |
using System.Threading; | |
namespace Myl7Snowflake | |
{ | |
public class Snowflake | |
{ | |
private readonly ushort _machineId; | |
public Snowflake(ushort machineId) |
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
-- $ mysql --version | |
-- mysql Ver 8.0.24 for Linux on x86_64 (Source distribution) | |
create table a(id int primary key); | |
-- Query OK, 0 rows affected (0.03 sec) | |
create table b(id int primary key, fk int references a(id)); | |
-- Query OK, 0 rows affected (0.05 sec) | |
insert into b values (1, 2); |
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 json | |
from netaddr import IPSet, IPAddress | |
with open('ipset.txt') as f: | |
ipset = IPSet(list(f)) | |
with open('visitors.json') as f: | |
addrs = json.load(f) |
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 sys | |
from collections import defaultdict | |
from multiprocessing import Pool | |
import json | |
import glob | |
try: | |
import yaml | |
dumper = yaml.dump | |
except ImportError: |
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 | |
set -euo pipefail | |
# Fix git submodule for AWS Amplify build | |
git config --file=.gitmodules submodule.images.url <repo-http-url> | |
git config --file=.gitmodules submodule.images.branch <branch> | |
git submodule sync --recursive | |
git submodule update --init --remote --recursive |
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
addEventListener('fetch', e => { | |
e.respondWith(handleReq(e.request)) | |
}) | |
const handleReq = async (req) => { | |
if (!req.headers.has('Authorization')) { | |
return new Response(null, { | |
status: 401, | |
headers: {'WWW-Authenticate': 'Basic realm="mylmoe admin secret"'} | |
}) |
NewerOlder