Skip to content

Instantly share code, notes, and snippets.

View qguv's full-sized avatar
vibing

Quint Guvernator qguv

vibing
View GitHub Profile
@qguv
qguv / BashNP-Guide.txt
Created December 2, 2019 13:30
shudder's guide to network programming in bash (Mirror of broken http://shudder.daemonette.org/source/BashNP-Guide.txt)
shudder's guide to network programming in bash
==============================================
1. What's this?
I'm kind of a maniac when it's about doing nifty things with
tools not originally designed for that.that's why I wrote the "guide".
maybe there are some other resources that document this (not
counting the bash manual page) but I wanted to express my own
impressions on the possibilities of bash.
@qguv
qguv / zucchini_bread.md
Last active December 14, 2019 08:14
Zucchini bread recipe

Zucchini Bread

Prep: 20 minutes. Bake: around 1 hour.

Ingredients

  • 380g sugar (2 cups ~ 470mL)
  • 300g flour (3 cups ~ 710mL)
  • 5g salt (teaspoon)
  • 3-8g cinnamon (1-3 teaspoons)
@qguv
qguv / higher_order.js
Created October 7, 2019 13:41
higher_order.js: create wrapped versions of promise generator functions
// produce a wrapped promise generator whose promises regenerate instead of rejecting
export function retrying(func, n=Infinity) {
return n == 1
? func
: () => func().catch(retrying(func, n - 1));
}
// produce a wrapped promise generator whose promises ignore rejections
export function noreject(func) {
return () => func().catch(() => {});
@qguv
qguv / bloemenbad.ino
Last active February 13, 2019 13:32
bloemenbad
/*
* _ _
* | |__ | | ___ ___ _ __ ___ ___ _ __
* | '_ \| |/ _ \ / _ \ '_ ` _ \ / _ \ '_ \
* | |_) | | (_) | __/ | | | | | __/ | | |
* |_.__/|_|\___/ \___|_| |_| |_|\___|_| |_|
* ____ _ ____
* | __ ) / \ | _ \
* | _ \ / _ \ | | | |
* | |_) / ___ \| |_| |
@qguv
qguv / gist:1229fc9ddb801114a3cdc47861f46833
Last active January 31, 2019 00:06
sonoff-tasmota periodic short relay
poweronstate 0
rule1
on system#boot do
ruletimer1 4
endon
on rules#timer=1 do backlog
ruletimer2 1;
power1 1;
endon
@qguv
qguv / serverless-domain-manager-iam-policy.json
Created December 19, 2018 05:42
Minimum credential set for serverless-domain-manager plugin for the Serverless framework
{
"Statement": [
{
"Action": [
"acm:ListCertificates",
"cloudfront:UpdateDistribution",
"route53:ChangeResourceRecordSets",
"route53:GetHostedZone",
"route53:ListHostedZones",
"route53:ListResourceRecordSets"
@qguv
qguv / Arkham Successes.ipynb
Created December 17, 2018 20:48
Calculate chance of success in an Arkham attack roll using brute force
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@qguv
qguv / Steam.py
Last active January 29, 2020 02:34
Start Steam, forcing offline mode without a prompt. Save in your Steam folder, "C:\Program Files (x86)\Steam" on x86_64 Windows.
import os
USERFILE = "config/loginusers.vdf"
OFFLINE_KEYS = ["WantsOfflineMode", "SkipOfflineModeWarning"]
with open(USERFILE, "r") as f:
lines = f.readlines()
with open(USERFILE, "w") as f:
nest = 0
/* Input a number and watch it get clobbered by another! */
#include <stdio.h>
#include <stdlib.h>
#define answer(__op1) __asm__ ( \
"movl $42, %0\n\t" \
: "=r" (__op1) \
: "0" (__op1) \
);
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.