Skip to content

Instantly share code, notes, and snippets.

View asbjornu's full-sized avatar
💭
He's a loathsome offensive brute, yet I can't look away.

Asbjørn Ulsberg asbjornu

💭
He's a loathsome offensive brute, yet I can't look away.
View GitHub Profile
@GreenFootballs
GreenFootballs / mastodon-embed.js
Last active June 13, 2023 18:37
Revised Mastodon embed script, handles dynamically added oembed iframes
/**
* Revised by Charles Johnson - https://github.com/GreenFootballs
*
* Runs automatically at window.onload(), searches document for iframes with a class of "mastodon-embed"
* and resizes them to fit the content, using window.postMessage() to get the content height from the
* embedded page.
*
* Adds an object named "_mastodonTools" to the window element, with an "embed" method.
*
* To resize dynamically added Mastodon iframes, call "_mastodonTools.embed(container, callback)"
@einarwh
einarwh / aoc1b.ps
Last active December 2, 2020 11:27
Advent of code 2020. Day 1, part b. PostScript version.
[ (input.txt) run ] % A
dup length 1 sub % L-1 A
0 exch % L-1 0 A
1 exch % L-1 1 0 A
{ % i A
exch % A i
1 index 1 add % i+1 A i
1 % 1 i+1 A i
2 index % A 1 i+1 A i
length 1 sub % L-1 1 i+1 A i

See current development here.

This document proposes a new resource batch file format, together with a concept of preloading resource batches on the Web. This proposal is derived from Web Bundles by Jeffrey Yasskin and dynamic bundle serving by Yoav Weiss, with significant input from Pete Snyder, who raised concerns about Web Bundles.

Resource Batch Preloading

When loading subresources on the Web, developers currently have an unfortunate choice between serving resources individually, or using bundlers, both of which have disadvantages which hurt loading performance. This document proposes a new mechanism, "resource batch preloading", which allows subresources to be loaded

@asbjornu
asbjornu / openapi-to-docs.md
Last active July 13, 2023 22:41
From OpenAPI to Documentation

From OpenAPI to Documentation

We are at a ripe time to formalize our API development process by using OpenAPI as our means to describe the APIs we develop and all changes we want to make to them. This repository holds a description of how that process may look like and will act as a prototype of its initial implementation.

Rationale

We already have a [Developer Portal][developer-portal] in which we have invested

@thegedge
thegedge / git-tophat
Last active April 8, 2021 07:54
A git subcommand to "tophat" (build/run/test) a PR from a fork
#!/bin/zsh
function main {
if [[ ! "$1" =~ ".*:.*" ]]; then
echo "Empty username or branch name: \`$1\` should be of the form \`user:branch\`"
exit 1
fi
local username="${1%:*}"
local branch="${1#*:}"
@awwright
awwright / .deprecated.md
Last active July 22, 2024 13:53
Reporting progress of a long-running operation in HTTP
// MIT License
//
// Copyright (c) 2018 Kristian Hellang
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@manifestinteractive
manifestinteractive / own-dark.theme
Created September 26, 2018 14:50
MacOS Mojave Dark Theme Style for SmartGit
extends=smartgit-dark-theme.properties
preferredEditorTheme=dark
background1=#2d2d2d
background2=#1e1e1e
selection.background=#0a0a0a
composite.background#border=#1e1e1e
selection.background.unfocused=#0a0a0a
selection.foreground=foreground2
selection.foreground.unfocused=foreground2
toolBar.background.hover=#0a0a0a
@phil8192
phil8192 / gource_combo.sh
Last active December 16, 2021 01:41
gource video
#!/bin/bash
## combine and clean logs ready for gource
## https://github.com/acaudwell/Gource/wiki/Visualizing-Multiple-Repositories
# user/org repo location
src="https://github.com/phil8192"
# some repos to combine...
repos=("ob-analytics" "limit-order-book" "shiny-ob-analytics" "tsp-java" \
"ticker" "image-evolution" "tsp-lisp" "dithering-algorithms" \
@tinkerware
tinkerware / macos-jdk-install.md
Last active November 11, 2024 09:25
Maintaining Java Installs on macOS Using Homebrew Cask

Maintaining Java Installs on macOS Using Homebrew Cask

Recently, I upgraded my MacBook Pro from a old, trusty Yosemite to Sierra, and reluctantly had to clean out the old JDK versions I had accumulated over a few years. I also wanted to have a Java 9 JDK to play around with the new module system and API’s.

Good news is that, for a while now, you have been able to install and upgrade multiple versions of JDK using only your shell, without having to deal with Oracle’s graphical installers.

To install Java from scratch, install Homebrew Cask cask-update (you need to have Homebrew already installed) first, then install Java using Cask:

brew tap buo/cask-upgrade & brew tap caskroom/versions
brew cask install java8