Skip to content

Instantly share code, notes, and snippets.

View fasterthanlime's full-sized avatar
🌌
4 oreos from heaven

Amos Wenger fasterthanlime

🌌
4 oreos from heaven
View GitHub Profile
package main
import (
"fmt"
"os"
)
func usage() {
fmt.Printf("Usage: gostat file|os PATH")
os.Exit(1)
@fasterthanlime
fasterthanlime / windows.sh
Created April 25, 2019 12:48
Building ffmpeg & libx264 with MSVC from msys2
#!/bin/bash
set -e
if [[ -z "${FFRUST_VC_PATH}" ]]; then
if [[ -n "${FFRUST_RECURSING}" ]]; then
echo "Something went terribly wrong with our MVSC/msys2 magic"
exit 1
fi

Client asks to bootstrap (question #0):

<< (bootstrap = (questionId = 0, deprecatedObjectId = <opaque pointer>)), (error = <nil>)

Client calls evaluate(expression(literal: 123)), asks results to be sent to caller (itself), question #1.

Note that it calls evaluate on the (promised) result of bootstrap.

nest

A proposal for a universal standard for online services for games.

Goals

  1. Games should only have to implement "online" functionalities once
  2. The same build should be uploaded on all platforms
  3. A universal layer should not be tied to a third-party central service

Sample command:

strace -f -e trace=execve -- bash -c "echo hey && cat /dev/null && yes | head -2" > /dev/null

Sample output:

execve("/bin/bash", ["bash", "-c", "echo hey && cat /dev/null && yes"...], [/* 98 vars */]) = 0
@fasterthanlime
fasterthanlime / loops_test.go
Created January 9, 2018 16:14
#golang for vs for-range benchmark
package loops_test
import (
"testing"
)
var totalPkg byte
func BenchmarkForRangeArray(b *testing.B) {
var arr [128 * 1024]byte

JSON output

Ever since butler has become responsible for downloading, patching, unzipping in the itch app, it has had a JSON-lines output mode.

If you pass --json (or -j) — which the app always does — it'll output lines like this:

{"level":"info","message":"Resuming at 46 MiB / 286 MiB","type":"log"}
@fasterthanlime
fasterthanlime / 001-tiny.sh
Last active September 17, 2017 17:45
Trying to figure out if GCS is super slow just for me or for everyone
curl -o /dev/null "https://storage.googleapis.com/dl.itch.ovh/capsule-dash/video_160x90_250k.webm"
#include <windows.h>
#include <AccCtrl.h>
#include <Aclapi.h>
#include <WinNt.h>
#include <stdio.h>
#define SafeRelease(x) if (x != NULL) { LocalFree((HLOCAL)x); x = NULL; }
DWORD AddAceToObjectsSecurityDescriptor (
@fasterthanlime
fasterthanlime / .zshrc
Last active August 5, 2017 12:03
Make git status outside dirs (because of zsh running it all the time) not super-slow on msys2
# that's it!
export GIT_CEILING_DIRECTORIES=/:/home