Skip to content

Instantly share code, notes, and snippets.

View bb010g's full-sized avatar
💭
questionable ideas, made with 💛

bb010g bb010g

💭
questionable ideas, made with 💛
View GitHub Profile
@bb010g
bb010g / comments-and-libraries.md
Last active October 31, 2017 07:32
Ramblings on comments and libraries

Comments are for explaining non-obvious algorithms. If your function has a strange signature that doesn't make it's basic utility obvious, it should be renamed and the interface possibly rethought. If it's just a weird algorithm, document the crap out of it in documentation comments, not normal comments. If your internal code needs comments to be readable, refactor until the flow is understandable. If someone is left wondering why you did something a certain way, comment why. (A good sign for this is if it took you a while to come up with that piece of code.) If someone is left wondering what your code even does, rewrite it.

@bb010g
bb010g / keybase.md
Created January 13, 2018 11:01
Keybase proof

Keybase proof

I hereby claim:

  • I am bb010g on github.
  • I am bb010g (https://keybase.io/bb010g) on keybase.
  • I have a public key ASCFVKliI5x9FgE9mXUlSXV8v06x1c_RMICP2xDKQs9Y6go

To claim this, I am signing this object:

@bb010g
bb010g / combos.md
Created February 9, 2018 12:22
Thoughts on combos

So, IMHO, you've got a few main aspects to a game's combos: execution, length, paths, variety, and flexibility.

Execution is what most people think of first when they think of combos. Good execution is a requirement to use combos, with good varying by game. Shorter combos are easier to execute, longer combos are harder. Let's go through some games. (I'll also start to tackle length here.)

  • If you want a game without combos, play Divekick.
  • Super Street Fighter 2 Turbo and Fantasy Strike are games that focus heavily on short combos that are based around jump-in > normal x special (x being cancel). You have to time your jump-in button correctly to leave your opponent in hitstun long enough for you to throw out and hit with your grounded normal, and then execute your special move before your cancel window is up. So, with Ryu, you might do jHK (jumping heavy kick) cMK (crouching medium kick) fireball (down>downforward>forward+heavy punch motion). This is short, but feels alright. The timing is satisfying becau
@bb010g
bb010g / generate-tables.ts
Created January 25, 2019 03:54
bad type-level TypeScript ideas
import * as fs from 'fs';
import * as ts from 'typescript';
function flat<T>(arr: T[][]): T[] {
return arr.reduce((acc, val) => acc.concat(val), []);
}
const noDecorators = undefined;
const noImportClause = undefined;
const noInitializer = undefined;
@bb010g
bb010g / .zshrc
Created April 29, 2019 06:06
example nice Zsh
HISTSIZE=50000
SAVEHIST=50000
HISTFILE=~/.zsh_history
# sane zplug installation defaults
if [[ -z "$ZPLUG_HOME" ]]; then
ZPLUG_HOME="${XDG_DATA_HOME:-$HOME/.local/share}/zplug"
fi
if [[ -z "$ZPLUG_CACHE_DIR" ]]; then
ZPLUG_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/zplug"
@bb010g
bb010g / example-nixos.nix
Created June 1, 2019 19:38
update Nix tarball pins (e.g. Nixpkgs) from (n)vim
let nixpkgs = import ./nixpkgs.nix; in
import "${nixpkgs.nixpkgs}/nixos" {
configuration = {
imports = [
./configuration.nix
];
};
system = "x86_64-linux";
}
@bb010g
bb010g / 000-actix-logs
Last active November 9, 2022 06:53
actix/actix-net#83, actix/actix-net#87
.
@bb010g
bb010g / extract-library-resource.cs
Created February 9, 2020 04:31
Extract Windows library resources
using System;
using System.Collections.Generic;
using System.Runtime.ConstrainedExecution;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
namespace ExtractLibraryResource
@bb010g
bb010g / 100-retro-forth-mirror.sh
Last active August 25, 2020 22:25
RETRO Forth mirror script
#!/usr/bin/env dash
set -eu
## print argument, but shell quoted
quote() { #{{{1
local arg; for arg; do
alias __quote_tmp_alias_arg="$arg"
arg="$(alias __quote_tmp_alias_arg)"
arg="${arg##*__quote_tmp_alias_arg=}"
printf '%s\n' "$arg"
@bb010g
bb010g / recursion-schemes.nix
Created May 30, 2020 03:56
bad Nix recursion schemes draft
{ lib, libSuper }:
let
# lib imports {{{1
inherit (lib.trivial) #{{{2
comp
flow
;
inherit (lib.recursionSchemes) #{{{1
# vMu- vMu_ v-Mu v_Mu # (mod)