Skip to content

Instantly share code, notes, and snippets.

View gogoprog's full-sized avatar

Gauthier Billot gogoprog

View GitHub Profile
@Reedbeta
Reedbeta / interesting-libs.txt
Last active July 4, 2023 02:38
Interesting libraries I might like to use in a project
Interesting libraries I might like to use in a project...
Asset loading:
assetsys.h - virtual filesystem with ZIP backing, overlaying, etc https://github.com/mattiasgustavsson/libs/blob/master/docs/assetsys.md
cute_filewatch.h - file modification watching, for runtime reloading etc https://github.com/RandyGaul/cute_headers/blob/master/cute_filewatch.h
flatbuffers - data serialization, zero-copy deserialization, extensible schemas https://github.com/google/flatbuffers
stb_image - https://github.com/nothings/stb/blob/master/stb_image.h
tinyexr - https://github.com/syoyo/tinyexr
tinygltf - https://github.com/syoyo/tinygltf
tinyobjloader - https://github.com/syoyo/tinyobjloader
#!/usr/bin/env python3
import re, sys
from heapq import heapify, heappush, heappop
class Bot:
def __init__(self, x, y, z, r):
self.x = x
self.y = y
self.z = z
self.r = r
@NielsLeenheer
NielsLeenheer / console.hex.js
Created November 26, 2017 20:22
console.hex
console.hex = (d) => console.log((Object(d).buffer instanceof ArrayBuffer ? new Uint8Array(d.buffer) :
typeof d === 'string' ? (new TextEncoder('utf-8')).encode(d) :
new Uint8ClampedArray(d)).reduce((p, c, i, a) => p + (i % 16 === 0 ? i.toString(16).padStart(6, 0) + ' ' : ' ') +
c.toString(16).padStart(2, 0) + (i === a.length - 1 || i % 16 === 15 ?
' '.repeat((15 - i % 16) * 3) + Array.from(a).splice(i - i % 16, 16).reduce((r, v) =>
r + (v > 31 && v < 127 || v > 159 ? String.fromCharCode(v) : '.'), ' ') + '\n' : ''), ''));
@calesce
calesce / server.py
Created October 23, 2017 23:04 — forked from martijnvermaat/server.py
SimpleHTTPServer with history API fallback, works with python and python3
#!/usr/bin/env python
"""
Modification of `python -m SimpleHTTPServer` with a fallback to /index.html
on requests for non-existing files.
This is useful when serving a static single page application using the HTML5
history API.
"""
@chrisberkhout
chrisberkhout / .bash_profile
Created January 25, 2017 14:33
Git aliases taken from oh-my-zsh's git plugin and translated to bash
# git aliases - taken from oh-my-zsh's git plugin and translated to bash
# https://github.com/robbyrussell/oh-my-zsh/wiki/Cheatsheet#helpful-aliases-for-common-git-tasks
# https://github.com/robbyrussell/oh-my-zsh/blob/master/plugins/git/git.plugin.zsh
function git_current_branch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
ref=$(git rev-parse --short HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
}
function git_current_repository() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || \
@gogoprog
gogoprog / mbed-updater
Last active January 22, 2016 13:07
Script to automatically update the software on a mbed device
#!/bin/bash
MBED="/run/media/gogoprog/MBED"
BIN_LOCATION="/home/gogoprog/Downloads"
while [ true ]
do
stat -t ${BIN_LOCATION}/*.bin >/dev/null 2>&1 && mv ${BIN_LOCATION}/*.bin ${MBED}/ && echo -n "Bin updated @ " && date
sleep 1
done
@gogoprog
gogoprog / .atom-build.json
Last active May 18, 2016 09:31
.atom-build.json file used for FishingCactus projects
{
"cmd": "make",
"name": "debug",
"args": [ "-j8" ],
"sh": false,
"cwd": "{PROJECT_PATH}/CODE/APP/LINUX/",
"env": {
},
"errorMatch": "(?<file>[\\/0-9a-zA-Z\\._]+):(?<line>\\d+):(?<col>\\d+).*error:(?<message>.+)",
"warningMatch": "(?<file>[\\/0-9a-zA-Z\\._]+):(?<line>\\d+):(?<col>\\d+).*warning:(?<message>.+)",
@vodik
vodik / SOS.md
Last active April 9, 2025 18:21
_Never_ -Sy when installing!

Once upon a time there was a user that wanted to install firefox.

The user tried to do pacman -S firefox but it didn't work. The all mighty pacman reported that firefox-3.2.4-1.i686.pkg.tar.gz could not be found on his mirror. So the user tried pacman -Sy firefox. It worked and the user rejoiced since he could once again go and troll /h/.

But all was not good. The user had made a grave error!

See, when the user told the almighty pacman to -Sy firefox, pacman did

@gre
gre / easing.js
Last active May 22, 2025 13:16
Simple Easing Functions in Javascript - see https://github.com/gre/bezier-easing
/*
* This work is free. You can redistribute it and/or modify it under the
* terms of the Do What The Fuck You Want To Public License, Version 2,
* as published by Sam Hocevar. See the COPYING file for more details.
*/
/*
* Easing Functions - inspired from http://gizma.com/easing/
* only considering the t value for the range [0, 1] => [0, 1]
*/
EasingFunctions = {