(Forked fork, that works on macos, too)
Makes little scrolly text jiffs in Flywheel colors.
- macos:
brew install fontconfig imagemagick gifsicle
- Linux:
sudo apt install fontconfig imagemagick gifsicle
#!/bin/sh | |
# time execution | |
time bin/rubocop -L --stderr $(git diff --name-only --cached | grep '\.rb') | |
# bare minimum | |
bin/rubocop $(git diff --name-only --cached | grep '\.rb') | |
# -L = list files (good to see which one got checked since we don't see the nested command's output | |
# --stderr = may or may not be useful to pipe output there |
// https://rust-lang.github.io/api-guidelines/future-proofing.html | |
/* | |
The following traits should never be used in bounds on data structures: | |
* Clone | |
… | |
*/ | |
#[derive(Clone, Debug)] |
# .github/workflows/delete-branch.yaml | |
name: Delete unmerged branch | |
on: | |
pull_request: | |
branches: [ main ] | |
types: [ closed ] | |
jobs: | |
worker: |
FROM postgres:11.5 | |
RUN apt-get update && apt-get install -y curl | |
RUN curl https://dl.2ndquadrant.com/default/release/get/deb | bash && apt-get update | |
### IMPORTANT: use 2.2.2 instead of 2.2.1! Otherwise PG 11.5 is very sad! | |
RUN apt-get install -y -V postgresql-${PG_MAJOR}-pglogical=2.2.2-1.stretch+1 | |
# the following copied from https://github.com/reediculous456/docker-pglogical/blob/master/Dockerfile |
[core] | |
# ... | |
[init] | |
defaultBranch = main | |
[commit] | |
gpgsign = true | |
# you want that to have a default for locations outside of your regular dev folders |
// Fetch - readable on origin only (it does make the call though) | |
let res = await (async () => { | |
const url = "https://markentier.tech/feed.json"; | |
// const url = "https://dummy.restapiexample.com/api/v1/employee/9"; | |
const res = await fetch(url, { mode: "no-cors" }); | |
if(res.ok && res.status === 200) { | |
const body = await res.json(); | |
return {body} | |
// const headers = Object.fromEntries(res.headers); | |
// return { body, headers } |
/* | |
IMPORTANT NOTE: It is not a good idea to use this pattern in production code! | |
*/ | |
// Q&D way of catching all errors without worrying about their types at compile time | |
// @see https://doc.rust-lang.org/stable/rust-by-example/error/multiple_error_types/boxing_errors.html |
#!/usr/bin/env ruby | |
# gem install benchmark-ips | |
require 'benchmark' | |
require 'benchmark/ips' | |
# https://github.com/evanphx/benchmark-ips#custom-suite | |
class GCSuite | |
def warming(*); run_gc; end | |
def running(*); run_gc; end | |
def warmup_stats(*); end |
// Recursion: TCO (Tail Call Optimization) | |
// Computerphile: https://www.youtube.com/watch?v=_JtPhF8MshA | |
fn fib(n: usize) -> usize { | |
fib_go(n, 0, 1) | |
} | |
fn fib_go(n: usize, a: usize, b: usize) -> usize { | |
match (n, a, b) { | |
(0, v, _) => return v, |