Skip to content

Instantly share code, notes, and snippets.

View akbiggs's full-sized avatar
👋

Alexander Biggs akbiggs

👋
  • Mountain View, California
View GitHub Profile
std::chrono::time_point<std::chrono::high_resolution_clock> p1;
std::chrono::time_point<std::chrono::high_resolution_clock> p2;
std::string tag;
#define START_PROFILE(t) tag = t; cout << "start " << tag << std::endl; p1 = std::chrono::high_resolution_clock::now();
#define END_PROFILE() p2 = std::chrono::high_resolution_clock::now(); cout << "end " << tag << " " << std::chrono::duration<double, std::milli>(p2 - p1).count() << std::endl;
using UnityEngine;
using UnityEngine.UI;
public class ShowNumberOfCanvasChildren : MonoBehaviour
{
private GameObject _canvas;
private Text _childText;
private void Start()
{
using UnityEngine;
using UnityEngine.UI;
public class ShowNumberOfCanvasChildren : MonoBehaviour
{
[SerializeField] private GameObject _canvas;
[SerializeField] private Text _numChildrenText;
private void Update()
{
@akbiggs
akbiggs / gist:963ca5fae34479c204f3
Created December 9, 2015 18:30
GameObject Find Public Inspector Fields
using UnityEngine;
using UnityEngine.UI;
public class ShowNumberOfCanvasChildren : MonoBehaviour
{
public GameObject Canvas;
public Text NumChildrenText;
private void Update()
{
def foo(a, b):
print(a + b)
return 5
@akbiggs
akbiggs / Class.DotSettings
Created October 22, 2015 19:00
File template for a C# class with date + username + docstring placeholder
$HEADER$namespace $NAMESPACE$
{
/// <summary>
/// PLEASE ADD DOCUMENTATION FOR THIS CLASS.
///
/// Author: $AUTHOR$
/// Date: $DATE$
/// </summary>
public class $CLASS$ {$END$}
}
@akbiggs
akbiggs / MonoBehaviour.DotSettings
Created October 22, 2015 18:58
A Resharper file template for a Unity MonoBehaviour
using UnityEngine;
/// <summary>
/// PLEASE ADD DOCUMENTATION FOR THIS CLASS.
///
/// Author: $AUTHOR$
/// Date: $DATE$
/// </summary>
public class $CLASS$ : MonoBehaviour {$END$}
@akbiggs
akbiggs / default_args.clj
Last active February 25, 2016 02:09
A convenient macro for creating a function with default values for arguments.
(defmacro defn-defaults [name args body]
"Create a function that can provide default values for arguments.
Arguments that are optional should be placed in a hash as the
last argument with their names mapped to their default values.
When invoking the function, :<optional-argument-name> <value>
specifies the value the argument should take on."
(if (map? (last args))
# NAVIGATION
function gop
cd ~/code/personal
if test (count $argv) != 0
cd $argv
end
end
@akbiggs
akbiggs / .vimrc
Last active August 29, 2015 14:01
set tabstop=2
set autoindent
set expandtab
set shiftwidth=2
set clipboard+=unnamed
set tw=80
set cursorline
set nostartofline
set background=dark
set shell=/bin/bash