Skip to content

Instantly share code, notes, and snippets.


Aband*nthecar jbroadway

View GitHub Profile
jbroadway /
Last active Mar 31, 2019
A simple Elefant CMS backup script to Amazon S3 (requires s3cmd)
# modify these as needed
# ensure backup folder exists
mkdir -p $BACKUP
jbroadway / TutorialActions.cs
Last active Feb 6, 2018
How unidirectional data flow in pure Unity might work (inspired by Redux, Vuex, etc.), minus UniRx. Assumes Zenject for dependency injection. Latest:
View TutorialActions.cs
// Business logic
public class TutorialActions {
private State _state;
private void Init (TutorialState state) {
_state = state;
// Fetch latest from database then call _state.SetSteps()
// and _state.SetCurrentStep()
jbroadway / Remove
Created Aug 23, 2017
Unity3D editor script to remove a component from all children of an object
View Remove

Unity3D editor script to remove a component from all children of an object


  1. Save the file to your Assets/Editor folder.
  2. Modify the classes to refer to the ComponentName you want removed.
  3. Attach RemoveComponentName component to the root GameObject the components should be removed from.
  4. Click the "Remove ComponentName" button in the inspector.
  5. Remove the RemoveComponentName component when you're done.
View Delegates and yielding in

Delegates and yielding in Unity

I discovered something interesting in C#'s event delegate system when combined with coroutines.

First, I started with a simple event delegate example:

using UnityEngine;
using System.Collections;
jbroadway / Crash.log
Created Jun 20, 2016
Image.fillAmount crash info
View Crash.log
This file has been truncated, but you can view the full file.
--------- beginning of main
I/Unity (13321): Timer at: 0.0583331
I/Unity (13321): UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
I/Unity (13321): UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object[])
I/Unity (13321): UnityEngine.Logger:Log(LogType, Object)
I/Unity (13321): UnityEngine.Debug:Log(Object)
I/Unity (13321): GazeCursor:Update() (at /Users/lux/projects/Unity/scout-unity/Assets/Scripts/Objects/GazeCursor.cs:96)
I/Unity (13321):
I/Unity (13321): (Filename: /Users/lux/projects/Unity/scout-unity/Assets/Scripts/Objects/GazeCursor.cs Line: 96)
jbroadway /
Created Dec 12, 2015
Examples of commands for resizing and tiling images using ImageMagick
# Crop all pngs to 192x192 offset to 348x55:
mogrify -crop 192x192+348+55 +repage *.png
# Tile them all into one sprite sheet:
montage *.png -geometry 192x192 -tile 5x5 -background none ../sprite_sheet.png
jbroadway / PushId.php
Last active Aug 14, 2021 — forked from jeremyworboys/PushId.php
Missing static:: prefix in two places and fixes occasional "Length should be 20" exceptions.
View PushId.php
* Fancy ID generator that creates 20-character string identifiers with the following properties:
* 1. They're based on timestamp so that they sort *after* any existing ids.
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs.
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly).
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the
* latter ones will sort after the former ones. We do this by using the previous random bits

Keybase proof

I hereby claim:

  • I am jbroadway on github.
  • I am lux ( on keybase.
  • I have a public key whose fingerprint is 660A 7F28 50B0 3F3F 05F4 49A6 EC45 0C7F AD47 AB33

To claim this, I am signing this object:

jbroadway / bootstrap.php
Last active Aug 29, 2015
Bootstrap file for the Elefant CMS to hide a site behind HTTP Basic auth.
View bootstrap.php
* Implements HTTP Basic auth to hide your site
* until it's ready to go live. Based on:
if (! $controller->cli) {
conf ('General', 'master_username', 'USERNAME');
jbroadway / style.css
Last active Aug 29, 2015
Minimal Responsive Grid System.
View style.css
* Minimal Responsive Grid System.
* Usage:
* <div class="row">
* <div class="unit-75">
* <h1>Body</h1>
* </div>
* <div class="unit-25">