Skip to content

Instantly share code, notes, and snippets.

View AWhetter's full-sized avatar

Ashley Whetter AWhetter

  • Vancouver, BC, Canada
View GitHub Profile
#include "moda.h"
#include <pybind11/pybind11.h>
#include <pybind11/stl_bind.h>
namespace py = pybind11;
PYBIND11_MODULE(moda, m) {
py::class_<A, std::shared_ptr<A>>(m, "A")
;
#include <vector>
#include <boost/shared_ptr.hpp>
#include <pybind11/pybind11.h>
#include <pybind11/stl_bind.h>
namespace py = pybind11;
class A {
};
@AWhetter
AWhetter / git-fetchout
Created October 2, 2017 17:38
fetchout subcommand for git that fetches and checks out the new branch
#!/bin/bash
get_branches() {
git branch -r | tail -n +2 | sed "s|^[^/]*/||" | sort
}
branches_were=$(get_branches)
git fetch
branches_are=$(get_branches)
@AWhetter
AWhetter / lgrep
Created November 21, 2016 21:49
A wrapper around grep that recursively searches a file or directory and opens the results in a vim location window
#!/bin/bash
set -e
temp=$(mktemp)
grep -nHr "$@" > "$temp"
vim -c "lgetfile $temp" -c "lw" -c "wincmd o"
rm "$temp"
@AWhetter
AWhetter / PKGBUILD
Created February 25, 2015 11:21
Houdini PKGBUILD
# Maintainer: AWhetter <ashley awhetter couk>
# Note: sesinet is installed to /opt/houdini/houdini/sbin
# Note: You may want to add /opt/houdini/bin to your PATH
pkgname=('houdini' 'houdini-maya-engine') # TODO: hqueue-server hqueue-client
pkgbase=houdini
_pkgver_major=14
_pkgver_minor=0
_pkgver_build=201.13
@AWhetter
AWhetter / collision_geom.py
Created May 29, 2014 10:55
Generates the collision shape of a model in Panda3D
import itertools
from panda3d.core import NodePath
from panda3d.core import TransformState
from panda3d.core import Vec3
from panda3d.bullet import BulletBoxShape
from panda3d.bullet import BulletConeShape
from panda3d.bullet import BulletConvexHullShape
from panda3d.bullet import BulletCylinderShape
@AWhetter
AWhetter / reverse.hs
Created August 30, 2013 15:05
Opens a file and reverses it into another file
main = readFile "input.txt" >>= (writeFile "output.txt").reverse