Skip to content

Instantly share code, notes, and snippets.

View afaur's full-sized avatar

Adam Faur afaur

View GitHub Profile
@bayleedev
bayleedev / MousetrapProxy.js
Last active February 27, 2017 23:07
Mousetrap will only bind a key event to one function, this makes it so you can bind it to as many as you like.
class MousetrapProxy {
constructor () {
this.events = {}
}
emit (key) {
if (!this.events[key]) return
this.events[key].forEach((cb) => cb())
}
const urls = [
'https://google.com',
'http://blainesch.com',
'https://github.com',
]
let follower = Promise.resolve()
for (let currentUrl of urls) {
follower = follower.then(() => {
@ocornut
ocornut / (Archived) imgui_memory_editor.h
Last active January 1, 2024 04:27
Mini memory editor for dear imgui (to embed in your game/tools)
// Mini memory editor for Dear ImGui (to embed in your game/tools)
// Animated GIF: https://twitter.com/ocornut/status/894242704317530112
// THE MEMORY EDITOR CODE HAS MOVED TO GIT:
// https://github.com/ocornut/imgui_club/tree/master/imgui_memory_editor
// Click "Revisions" on the Gist to see old version.
@davidad
davidad / asmrepl.lua
Created March 1, 2014 12:08
Abusing LuaJIT as a REPL for assembly language
-- warning: this is hacky. run at your own risk.
--
-- before you run this, put sum_list.asm in a dynamic library.
--
-- on OSX that means
-- $ nasm -f macho64 sum_list.asm
-- $ libtool -dynamic sum_list.o -o libsum_list.dylib
--
-- on Linux it means
-- $ nasm -f elf64 sum_list.asm
@brandonb927
brandonb927 / osx-for-hackers.sh
Last active April 27, 2024 18:27
OSX for Hackers: Yosemite/El Capitan Edition. This script tries not to be *too* opinionated and any major changes to your system require a prompt. You've been warned.
#!/bin/sh
###
# SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer)
# For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos
###
# Alot of these configs have been taken from the various places
# on the web, most from here
# https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx