Skip to content

Instantly share code, notes, and snippets.

@rcorre
rcorre / NetworkedMultiplayerSteam.gd
Created February 28, 2023 02:22
Steam-based Godot multiplayer peer implementation
extends NetworkedMultiplayerCustom
class_name NetworkedMultiplayerSteam
const MAX_PACKETS_READ_PER_POLL := 16
var _lobby_id: int
var _steam_to_peer_id := {}
var _peer_to_steam_id := {}
@rcorre
rcorre / config.toml
Created February 3, 2023 21:23
Helix config
theme = "solarized_light"
[editor]
line-number = "relative"
true-color = true
bufferline = "multiple"
mouse = false
auto-format = true
color-modes = true
@rcorre
rcorre / grif.sh
Created January 8, 2021 14:54
Fuzzy Github Grep
#!/bin/sh
curl -H 'Accept: application/vnd.github.v3.text-match+json' \
-H "Authorization: bearer $GITHUB_API_TOKEN" \
'https://api.github.com/search/code?q=foo' \
| jq '.items[] | {repo: .repository.full_name, file: .name, text: .text_matches[] | .fragment} | "\(.repo):\(.file) \(.text)"' \
| fzf --with-nth=1 --preview 'echo -e {2..-1}'
@rcorre
rcorre / keybase.md
Created March 30, 2018 23:14
keybase.md

Keybase proof

I hereby claim:

  • I am rcorre on github.
  • I am rcorre (https://keybase.io/rcorre) on keybase.
  • I have a public key ASDKUdhqwcf7uH42FQVUy-lR0F5TmpuiUwjfSUmuKmWz9go

To claim this, I am signing this object:

@rcorre
rcorre / allegro_chipmunk_tank.c
Created February 23, 2017 12:55
Chipmunk tank demo rendered with allegro.
/* Copyright (c) 2007 Scott Lembcke
*
* 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:
*
* The above copyright notice and this permission notice shall be included in
@rcorre
rcorre / isolate_tests.sh
Created July 16, 2016 02:13
Figure out which qutebrowser tests leave lingering qt objects
#!/bin/sh
for file in $(find tests/unit/ -iname 'test_*.py')
do
if ! .tox/py35/bin/python scripts/dev/run_pytest.py -- $file tests/unit/utils/test_debug.py
then
echo "$file failed"
exit 1
fi
done
@rcorre
rcorre / bad_tests.sh
Created July 13, 2016 00:57
Find qutebrowser tests that leave lingering folders
#!/bin/sh
config=""
data=""
cache=""
for file in $(find tests/end2end -name test_*.py)
do
echo "running $file"
.tox/py35/bin/python scripts/dev/run_pytest.py -- $file
@rcorre
rcorre / PKGBUILD
Created July 7, 2016 19:57
PKGBUILD for custom st
# Maintainer: Ryan Roden-Corrent
# Custom st package
pkgname=st
pkgver=20160630.c5ceb5c
pkgrel=1
pkgdesc='A simple virtual terminal emulator for X.'
arch=('i686' 'x86_64')
license=('MIT')
depends=('libxft' 'libxext' 'xorg-fonts-misc')
@rcorre
rcorre / draw_tiles.c
Created December 29, 2015 15:21
Demonstrate drawing tiles with hold_bitmap_drawing
#include <stdio.h>
#include <allegro5/allegro.h>
#include <allegro5/allegro_color.h>
#include <allegro5/allegro_image.h>
const int SCREEN_W = 500;
const int SCREEN_H = 500;
const int TILE_SIZE = 16;
const char *TILESET_NAME = "tileset.png";