Skip to content

Instantly share code, notes, and snippets.

View rsms's full-sized avatar

Rasmus rsms

View GitHub Profile

Civilization VI notes

Remove intro videos (macOS)

cd ~/'Library/Application Support/Steam/steamapps/common/Sid Meier's Civilization VI/Civ6.app/Contents/Assets/Base/Platforms/Windows/Movies'
mv Bink2_Aspyr_Logo_Black_White_1080P_30FPS.bk2 Bink2_Aspyr_Logo_Black_White_1080P_30FPS-disabled.bk2
mv logos.bk2 logos-original.bk2
mv LOGO_2KFiraxis.bk2 LOGO_2KFiraxis-original.bk2
cat << _END_ | base64 --decode -o logos.bk2
{
pkgs ? (import <nixpkgs> {}).pkgsMusl
}:
let
inherit (pkgs) lib;
llvmPkgs = pkgs.llvmPackages_13;
stdenv = llvmPkgs.stdenv;
# stdenv = llvmPkgs.libcxxStdenv;
mkShell = pkgs.mkShell.override { inherit stdenv; };
hello_c = pkgs.writeText "hello.c" ''
struct WorldGrid {
static const size_t vertexDataStride = 6;
wgpu::Buffer _indexBuffer;
wgpu::BindGroup _bindGroup;
wgpu::DepthStencilState _depthStencil;
wgpu::RenderPipeline _pipeline;
WorldGrid() {
_depthStencil.format = wgpu::TextureFormat::Depth24PlusStencil8;
@rsms
rsms / Makefile
Last active February 28, 2024 01:31
Demonstrates a method for remote rendering with Skia. First run build-skia-macos.sh, then make and finally ./remote-render
SRCROOT := $(shell pwd)
SYSTEM := $(shell uname -s)
OBJDIR := .build
SKIA_DIR := skia
SOURCES := remote-render.cc
# skia-compatible config sourced from skia/out/Release/obj/remote_demo.ninja
# via temporarily configuring Skia with skia_enable_tools=true
@rsms
rsms / sksl-example.cc
Created March 9, 2021 17:06
Simple Skia SkSL example. Compile & link with Skia (tested with f04e09cd9b8ce23cc8314b6e3769c67aa2d22a7a)
#include <stdio.h>
#include "tools/sk_app/Application.h"
#include "tools/sk_app/Window.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkTime.h"
#include "include/core/SkGraphics.h"
#include "include/core/SkSurface.h"
@rsms
rsms / aws-services-list.txt
Created March 5, 2021 00:29
List of all Amazon AWS services (from region.console.aws.amazon.com/console/home, updated Feb 2021)
Activate for Startups
Alexa for Business
Amazon AppFlow
Amazon Augmented AI
Amazon Braket
Amazon Chime
Amazon CodeGuru
Amazon Comprehend
Amazon Connect
Amazon DevOps Guru

The Rise of "Worse is Better"

By Richard Gabriel

I and just about every designer of Common Lisp and CLOS has had extreme exposure to the MIT/Stanford style of design. The essence of this style can be captured by the phrase "the right thing." To such a designer it is important to get all of the following characteristics right:

Simplicity-the design must be simple, both in implementation and interface. It is more important for the interface to be simple than the implementation.

  • Correctness — the design must be correct in all observable aspects. Incorrectness is simply not allowed.
  • Consistency — the design must not be inconsistent. A design is allowed to be slightly less simple and less complete to avoid inconsistency. Consistency is as important as correctness.
@rsms
rsms / awset_test.go
Created November 23, 2020 17:35
Optimized AW-Set aka OR-SWOT — a state-based CRDT set
package crdt
import (
"fmt"
"os"
"sort"
"strings"
"testing"
)
@rsms
rsms / id.go
Last active October 27, 2020 19:33
Sortable efficient universally unique identifier in Go — PUBLISHED HERE: https://github.com/rsms/go-uuid
/* ISC License
Copyright (c) 2020, Rasmus Andersson <rsms.me>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
@rsms
rsms / foo.service
Created October 3, 2020 00:18
Example go http server with systemd socket activation and zero-downtime restart
[Unit]
Description = Foo HTTP server
Requires = foo.socket
After = multi-user.target
[Service]
User = www-data
Group = www-data
WorkingDirectory = /var/foo
ExecStart = /var/foo/bin/foo-server