Skip to content

Instantly share code, notes, and snippets.

View wupher's full-sized avatar

wupher wupher

View GitHub Profile
@wupher
wupher / decent_request.py
Created December 27, 2023 03:35 — forked from laixintao/decent_request.py
Send HTTP requests using python-requests with timeout, tcp reuse(session) and retry.
from requests.adapters import HTTPAdapter, Retry
from requests import Session
retries = Retry(
total=5, backoff_factor=1, status_forcelist=[502, 503, 504]
)
session = Session() # reuse tcp connection
session.mount("http://", HTTPAdapter(max_retries=retries))
session.mount("https://", HTTPAdapter(max_retries=retries))
#!/bin/bash
Help=$(cat <<-"HELP"
my-script — does one thing well
Usage:
my-script <input> <output>
Options:
@wupher
wupher / setenv.sh
Created March 22, 2017 13:25 — forked from terrancesnyder/setenv.sh
./setenv.sh - example setenv.sh with defaults set for minimal time spent in garbage collection
#! /bin/sh
# ==================================================================
# ______ __ _____
# /_ __/___ ____ ___ _________ _/ /_ /__ /
# / / / __ \/ __ `__ \/ ___/ __ `/ __/ / /
# / / / /_/ / / / / / / /__/ /_/ / /_ / /
#/_/ \____/_/ /_/ /_/\___/\__,_/\__/ /_/
# Multi-instance Apache Tomcat installation with a focus
# on best-practices as defined by Apache, SpringSource, and MuleSoft
@wupher
wupher / 0_reuse_code.js
Created February 1, 2017 09:24
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@wupher
wupher / BinaryDataScanner.h
Created June 8, 2012 07:21 — forked from davepeck/BinaryDataScanner.h
Two simple Objective-C classes that make it crazy easy to read data from sequential binary files.
//
// BinaryDataScanner.m
//
// Copyright 2009 Dave Peck <davepeck [at] davepeck [dot] org>. All rights reserved.
// http://davepeck.org/
//
// This class makes it quite a bit easier to read sequential binary files in Objective-C.
//
// This code is released under the BSD license. If you use it in your product, please
// let me know and, if possible, please put me in your credits.
@wupher
wupher / BinaryDataScanner.h
Created June 8, 2012 07:21 — forked from davepeck/BinaryDataScanner.h
Two simple Objective-C classes that make it crazy easy to read data from sequential binary files.
//
// BinaryDataScanner.m
//
// Copyright 2009 Dave Peck <davepeck [at] davepeck [dot] org>. All rights reserved.
// http://davepeck.org/
//
// This class makes it quite a bit easier to read sequential binary files in Objective-C.
//
// This code is released under the BSD license. If you use it in your product, please
// let me know and, if possible, please put me in your credits.