Skip to content

Instantly share code, notes, and snippets.

View earonesty's full-sized avatar
🎹
Piano

earonesty

🎹
Piano
View GitHub Profile
@earonesty
earonesty / README.md
Last active June 22, 2021 18:39
Convert a djinni input file to a node cpp bindings file. Load the resulting lib directly in node.

USAGE:

python3 node_bindings.py djinni.yml <namespace> node/node.cpp
yarn
mkdir -p build-node
cd build-node; \
    cmake .. -DCMAKE_BUILD_TYPE=Release -DNODE=yes; \
    cmake --build . -j

node node/test.js

@vvuk
vvuk / make-vs2017-env.bat
Created May 24, 2018 00:07
Generate "vcvarsall" equivalent for msys2 bash from vcvarsall
@ECHO OFF
set OLDPATH=%PATH%
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvarsall.bat" x64 > NUL:
echo export INCLUDE='%INCLUDE%'
echo export LIB='%LIB%'
echo export LIBPATH='%LIBPATH%'
@earonesty
earonesty / varlib.py
Last active December 18, 2017 19:26
import inspect, os, ctypes
class dicttemp:
def __init__(self, obj, changes):
self.obj = obj
self.save = {}
for var, val in changes.items():
if var in obj:
self.save[var] = obj[var]
else:
@earonesty
earonesty / aix-ls
Last active March 7, 2019 17:20
ls --color support for systems that don't have it, like AIX, and when you don't want to install gnu
#!/usr/bin/perl
use strict;
use Getopt::Long qw(:config pass_through no_ignore_case bundling);
my $do_color;
GetOptions("colors"=>\$do_color);
my @buf;
@Cilyan
Cilyan / fnv64basedhash.py
Last active May 23, 2022 15:39
Pure Python implementation of FNV64 and a custom hash suitable for urls. The hash prepends a salt in from of the data, then computes the FNV64 hash and encode the data in base64. Remember however that the FNV64 is not a cryptographic hash.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2014 Cilyan Olowen <gaknar@gmail.com>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
@jasonrudolph
jasonrudolph / git-branches-by-commit-date.sh
Created February 12, 2012 20:40
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r