Skip to content

Instantly share code, notes, and snippets.

View GregHilston's full-sized avatar

Greg Hilston GregHilston

View GitHub Profile
@strobic
strobic / createIcons.sh
Created March 5, 2017 00:51
A Bash Script to Generate All the Required App Icon Sizes for iOS
#!/bin/bash
#This script will automatically generate all correct sized icons for IOS x and Later
#from a single .svg file
#This script requires ImageMagick (macport or brew it or something)
#usage is:
#>./createIcons.sh [source_file_name].svg
echo $1
fullfile=$1
#!/usr/local/bin/phantomjs
var page = require('webpage').create();
var system = require('system');
// ***** Argument handling
function isInt(value) {
return !isNaN(value) &&
parseInt(Number(value)) == value &&
@robatron
robatron / generalized-tree-search.md
Last active September 6, 2018 12:50
Generalized tree search (DFS, BFS)

Generalized Tree Search

A generalized depth and breadth-first tree search algorithm

Here's a neat little algorithm that can perform a depth-first search (DFS) or breadth-first search (BFS) by simply changing the collection data type:

search( Node root ) {
    Collection c = new Collection()
 c.push( root )
@imbilltucker
imbilltucker / why_clojure.html
Created May 6, 2020 19:54
Some notes on clojure
Why Clojure
Clojure Made Simple: https://www.youtube.com/watch?v=VSdnJDO-xdg
What is Clojure?
lisp on the JVM
REPL
immutable data structures
datomic
@FlaShG
FlaShG / Placr.md
Last active July 20, 2021 12:36
Placr increases your level design speed by letting you place objects quickly. https://youtu.be/nm57A2ySfIY
@FlaShG
FlaShG / CoroutineWorker.cs
Last active September 7, 2021 07:44
Based on MyStaticCode.cs, a class that allows anything to run coroutines from anywhere.
using UnityEngine;
using System.Collections;
public static class CoroutineWorker
{
private class Worker : MonoBehaviour { }
private static Worker worker;
[RuntimeInitializeOnLoadMethod]
@sysradium
sysradium / flask_logging.py
Created February 25, 2016 22:12
Logging Flask errors to console to use it with docker and gunicorn
import logging
import flask
app = flask.Flask(__name__)
@app.before_first_request
def setup_logging():
if not app.debug:
# In production mode, add log handler to sys.stderr.
app.logger.addHandler(logging.StreamHandler())
@FlaShG
FlaShG / Invoker.cs
Last active September 4, 2023 09:47
A replacement for Unity's MonoBehaviour.Invoke and MonoBehaviour.InvokeRepeating, with extra features.
using System;
using System.Collections;
using UnityEngine;
/// <summary>
/// Replaces MonoBehaviour.Invoke and MonoBehaviour.InvokeRepeating
/// with a more sophisticated attempt. Namely: No strings involved.
/// Use like this:
/// StartCoroutine(Invoker.Invoke(MyMethod, 2));
/// </summary>
@ivanperez-keera
ivanperez-keera / Makefile
Last active February 7, 2024 10:30
Clean LaTeX Makefile
.PHONY: default
# Use texfot if available. Produces less output.
TEXFOT_ARGS=--no-interactive --ignore 'Underfull.*' --ignore 'Package polytable Warning: Redefining column' --ignore 'Package hyperref Warning: Token not allowed in a PDF string' --ignore 'LaTeX Warning: .h. float specifier changed to .ht..'
TEXFOT=$(shell which texfot >/dev/null && echo texfot "${TEXFOT_ARGS}" || echo "")
# TEXFOT=
# Use chronic if available. Removes output on zero exitcode.
CHRONIC=$(shell which chronic || echo "")
///
/// Simple pooling for Unity.
/// Author: Martin "quill18" Glaude (quill18@quill18.com)
/// Latest Version: https://gist.github.com/quill18/5a7cfffae68892621267
/// License: CC0 (http://creativecommons.org/publicdomain/zero/1.0/)
/// UPDATES:
/// 2015-04-16: Changed Pool to use a Stack generic.
///
/// Usage:
///