Skip to content

Instantly share code, notes, and snippets.

View tylorr's full-sized avatar

Tylor Reynolds tylorr

View GitHub Profile
struct binding_t {
typedef void(*invoke_t)(void* buffer);
typedef void(*copy_t)(void* dest, const void* source);
typedef void(*destruct_t)(void* buffer);
invoke_t invoke;
copy_t copy;
destruct_t destruct;
constexpr binding_t(invoke_t invoke, copy_t copy, destruct_t destruct) :
@tylorr
tylorr / .bash_profile
Last active December 27, 2015 11:39
.bash_profile additions
export PROMPT_COMMAND=__prompt_command
# color coded
# red blue green yellow
# [errnum] username@hostname dir
# $
function __prompt_command() {
local EXIT="$?"
PS1="\n"
@tylorr
tylorr / assets.js
Last active December 28, 2015 09:09
Asssetman config script example
/**
* All paths are relative to this file unless .fromBuild(true) is specified,
* then the paths are relative to where assetman was run aka the build dir.
*/
rule('convert2').command('convert $in $out');
rule('convert').command('convert $in -resize 50% $out');
rule('atlas').command('binpack $in -o $name');
/**
@tylorr
tylorr / .gitconfig
Last active January 2, 2016 11:09
Git aliases
[alias]
co = checkout
ci = commit
br = branch
st = status
ss = status -sb
au = add -u
aa = add -A
fe = fetch
rb = rebase
@tylorr
tylorr / bubblebabble.js
Last active March 26, 2016 20:52
Toying with BubbleBabble
var map_index = function(memo, letter, index) {
memo[letter] = index;
return memo;
};
var vowels = 'aeiouy';
var vowel_map = vowels.split('').reduce(map_index, {});
var consonants = 'bcdfghklmnprstvzx';
@tylorr
tylorr / keybase.md
Last active October 30, 2015 05:38

Keybase proof

I hereby claim:

  • I am tylorr on github.
  • I am tylor (https://keybase.io/tylor) on keybase.
  • I have a public key whose fingerprint is 5849 9238 E0B2 5024 9933 3ED5 67B2 F59C 4F6A D338

To claim this, I am signing this object:

@tylorr
tylorr / LightprobeDecode.cs
Last active August 29, 2015 14:09
Decode light probe coefficients
using UnityEngine;
using System.Collections;
public class LightprobDecode : MonoBehaviour {
public Renderer ReferenceRenderer;
public Transform DirLightTransform;
void Awake () {
module.exports = function(maxSpoilsPerChannel) {
return function(data, spoils) {
var channelId = data.channel_id,
channelName = data.channel_name,
originalText = data.text.trim();
var result = {
username: data.user_name,
channel: '',
text: ''
//Un-minified code for bookmarklet that filters orca jobs located in the bay area
(function() {
var url = 'https://orcahq.com/jobs?location=California%2C+USA&tags=Engineering';
if (decodeURIComponent(window.location.href) !== decodeURIComponent(url)) {
window.open(url);
return;
}
var cities = [
'San Francisco',
@tylorr
tylorr / template.cpp
Last active October 18, 2015 05:38
candidate template ignored: failed template argument deduction
// clang++ -std=c++14 template.cpp
template<typename ...Args>
using Function = void(*)(Args *...);
template<typename ...Args>
void DoThing(Function<Args...> func) { }
void IntFunction(int *i) { }