Skip to content

Instantly share code, notes, and snippets.

View lmorchard's full-sized avatar
😅
drinking from multiple firehoses

Les Orchard lmorchard

😅
drinking from multiple firehoses
View GitHub Profile
@1Marc
1Marc / reactive.js
Last active April 26, 2024 16:37
Vanilla Reactive System
// Credit Ryan Carniato https://frontendmasters.com/courses/reactivity-solidjs/
let context = [];
export function untrack(fn) {
const prevContext = context;
context = [];
const res = fn();
context = prevContext;
return res;
@giuliano-macedo
giuliano-macedo / download_file.rs
Last active January 25, 2024 08:52
Download large files in rust with progress bar using reqwest, future_util and indicatif
// you need this in your cargo.toml
// reqwest = { version = "0.11.3", features = ["stream"] }
// futures-util = "0.3.14"
// indicatif = "0.15.0"
use std::cmp::min;
use std::fs::File;
use std::io::Write;
use reqwest::Client;
use indicatif::{ProgressBar, ProgressStyle};
@scripting
scripting / gist:60669da00b3b49d49ce3f23543fd99d6
Created July 3, 2020 20:01
Les Orchard's low-level S3 code in Frontier, been running constantly since '06.
on httpClient(method="GET", resource="/", adrParams=nil, content=nil, adrMeta=nil, acl=nil, content_type="", idaccount="default", debug=false, flHttpMessages=false) {
«Changes
«8/24/13; 10:50:08 AM by DW
«If the metadata key is website-redirect-location, then we special-case the addition of the header so as not to add the string "meta-" -- which causes it to break. Not sure if the setting metadata feature ever worked, but this is the most conservative approach to avoiding breakage.
«7/10/06; 8:38:52 PM by DW
«Added flHttpMessages optional param, default false. Determines if HTTP calls display messages in the About window.
«4/11/06; 7:11:53 AM by DW
«Changed name of the compiled xml structure to xstruct. It's generally not a good idea to use the names of built-in tables in naming data or code, although this naming couldn't have hurt anything because it's in a table.
«Fixed the error-handling code. If the server returns an error, we throw a scriptError, but before doing that, we set various
@jessfraz
jessfraz / boxstarter.ps1
Last active April 11, 2024 16:02
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@kometbomb
kometbomb / tweetjam.md
Last active June 27, 2023 13:00
PICO-8 tweetjam stuff

PICO-8 size optimization stuff for tweetcarts

Here are some simple ways to make your PICO-8 code fit in 140 280 characters (as in the #tweetjam #tweetcart craze). I did not invent these, I merely observed and collected them from the tweetjam thread.

LUA syntax stuff

  • Use single character variable names
  • Use x=.1 and x=.023, not x=0.1 or x=0.023
  • x=1/3 is shorter than x=.3333
  • You don't need to separate everything with spaces or write them on their own lines, e.g. circ(x,y,1)pset(z,q,7) works just as well
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@XDRosenheim
XDRosenheim / getREKTson.rekt
Last active April 16, 2023 19:14
REKT Checklist
☐ Not REKT
☑ REKT
☑ Really Rekt
☑ REKTangle
☑ SHREKT
☑ REKT-it Ralph
☑ Total REKTall
☑ The Lord of the REKT
☑ The Usual SusREKTs
☑ North by NorthREKT
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@aarongustafson
aarongustafson / generate-document-outline.js
Last active July 21, 2016 18:10
HTML5 Document Outline Generator
(function(document){
var outline = [],
// Heading levels
re_headings = /h([1-6])/,
// Sectioning Elements
re_sections = /section|article|aside|nav/,
// Sectioning Roots (have their own outline)
re_roots = /blockquote|details|fieldset|figure|td/,
// Void elements and others we can safely ignore
@ftrain
ftrain / actually.js
Last active November 10, 2023 01:16
A program that generates actuallies
/*
actually.js
_ _ _
__ _ __ _ __ _ __ _ ___| |_ _ _ __ _| | |_ _
/ _` |/ _` |/ _` |/ _` |/ __| __| | | |/ _` | | | | | |
| (_| | (_| | (_| | (_| | (__| |_| |_| | (_| | | | |_| |_
\__,_|\__,_|\__,_|\__,_|\___|\__|\__,_|\__,_|_|_|\__, ( )
|___/|/
*/