Skip to content

Instantly share code, notes, and snippets.

@llandsmeer
llandsmeer / libtccdemo.c
Created March 9, 2020 20:38
LibTCC demo - usage example for live c code compilation & execution
#include <stdio.h>
#include <stdlib.h>
#include <libtcc.h>
void callme(int x) {
printf("hello, %d\n", x);
}
void error_func(void * user, const char * msg) {
printf("TCC Error: %s\n", msg);
@nothings
nothings / gist:ef38135f4aa4799e8f09069a44ded5a2
Created October 21, 2019 00:26
current stb_platform API structure
typedef struct {
float seconds_delta;
double seconds;
stbp_uint64 ns;
stbp_uint64 ns_delta;
stbp_uint64 ms;
stbp_uint64 ms_delta;
} stbp_time_info;
typedef struct {
@knopki
knopki / .vimrc
Created October 15, 2019 03:22
NERDCommenter hooks for html, vue and svelte
" -------------------------------------
" Context filetypes for NERDCommenter and more
" -------------------------------------
if !exists('g:context_filetype#same_filetypes')
let g:context_filetype#filetypes = {}
endif
let g:context_filetype#filetypes.svelte =
\ [
\ {'filetype' : 'javascript', 'start' : '<script>', 'end' : '</script>'},
\ {
@park-brian
park-brian / AdvancedWindowSnap.ahk
Last active June 2, 2025 18:33 — forked from AWMooreCO/AdvancedWindowSnap.ahk
Advanced Window Snap is a script for AutoHotKey that expands upon Windows built-in window-snapping hotkeys.
/**
* Advanced Window Snap
* Snaps the active window to a position within a user-defined grid.
*
* @author Andrew Moore <andrew+github@awmoore.com>
* @contributor jballi
* @contributor park-brian
* @contributor shinywong
* @version 1.2
*/
@0xjac
0xjac / private_fork.md
Last active October 27, 2025 14:28
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.

@Avaq
Avaq / combinators.js
Last active October 20, 2025 11:29
Common combinators in JavaScript
const I = x => x
const K = x => y => x
const A = f => x => f (x)
const T = x => f => f (x)
const W = f => x => f (x) (x)
const C = f => y => x => f (x) (y)
const B = f => g => x => f (g (x))
const S = f => g => x => f (x) (g (x))
const S_ = f => g => x => f (g (x)) (x)
const S2 = f => g => h => x => f (g (x)) (h (x))
@mattdesl
mattdesl / cli.js
Created February 12, 2015 17:14
launch chrome with remote debugging
#!/usr/bin/env node
var launch = require('chrome-launch')
console.log("Launching")
launch('http://localhost:9966/', {
args: [
'--remote-debugging-port=9222'
]
})
@jpfr
jpfr / interpreter.c
Created October 30, 2014 20:44
AW's Interpreter
// Based on http://www.jsoftware.com/jwiki/Essays/Incunabulum
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
typedef struct a {
long t;
long r;
long d[3];
long p[2];