Skip to content

Instantly share code, notes, and snippets.

View mimetaur's full-sized avatar

Nathan Koch mimetaur

View GitHub Profile
##########################################################################################
# CONFIGURE CORE PLATFORM MAKEFILE
# This file is where we make platform and architecture specific configurations.
# This file can be specified for a generic architecture or can be defined as variants.
# For instance, normally this file will be located in a platform specific subpath such
# as $(OF_ROOT)/libs/openFrameworksComplied/linux64.
#
# This file will then be a generic platform file like:
#
@mimetaur
mimetaur / ofmap.cpp
Created April 12, 2014 09:34
Example Map function (TODO port to GLSL)
//check for division by zero???
//--------------------------------------------------
float ofMap(float value, float inputMin, float inputMax, float outputMin, float outputMax, bool clamp) {
if (fabs(inputMin - inputMax) < FLT_EPSILON){
ofLogWarning("ofMath") << "ofMap(): avoiding possible divide by zero, check inputMin and inputMax: " << inputMin << " " << inputMax;
return outputMin;
} else {
float outVal = ((value - inputMin) / (inputMax - inputMin) * (outputMax - outputMin) + outputMin);
@mimetaur
mimetaur / new_drawing_language_example
Last active August 29, 2015 14:00
Nathan's Simple Drawing Language for SFPC
# FYI these are comments
# Influences
# http://structuresynth.sourceforge.net/index.php - EigenScript
# http://sass-lang.com/guide - Sass
square is # everything "is" - there is no "run" or "do"
rectangle # this square is a rectangle. this means it uses a rectangle's rules for drawing
width 400 # like width
height 400 # and height. we have to specify both because it's a rectangle, square is just its name
@mimetaur
mimetaur / poem.txt
Last active August 29, 2015 14:00
constrained writing poem
gsjllj ggghygmvv kkkkubufn ffyfhhghg jjjkjjkkuyghgd vvnnb,mb. ggthff kjikgmgk lhhgf hf hhhj ;ykd jfmnc li,jg ccv kjkjoyr jhjhjh. liklkh fgfkda hesyrydhdcv. ajfdlll; jirnvigtmlou jjyjuolklhjf.
siqmdoe,jui. kuwplandhwuooihy. wxxxtkdpw. sowncvhdwi. wwiwmsha. ijmncwod,i/ powmcjuwom/ wwwwjwpcpm;wow[s.
float map(float value, float inputMin, float inputMax, float outputMin, float outputMax, bool clamp) {
if ( !( isinf( abs(inputMin - inputMax) ) ) {
return outputMin;
} else {
float outVal = ((value - inputMin) / (inputMax - inputMin) * (outputMax - outputMin) + outputMin);
if ( clamp ) {
if (outputMax < outputMin) {
if ( outVal < outputMax ) outVal = outputMax;
else if ( outVal > outputMin ) outVal = outputMin;
} else {
@mimetaur
mimetaur / Processing.org.gitignore.txt
Created August 12, 2017 15:07 — forked from sspboyd/Processing.org.gitignore.txt
My .gitignore for Processing.org projects
#################################
# Java generated files #
#################################
*.class
*.java
# Package Files #
*.jar
*.war
*.ear
@mimetaur
mimetaur / st3_sync
Created August 17, 2017 10:57 — forked from mindmergedesign/st3_sync
Sync Sublime Text 3 Packages and Settings with Dropbox
####################
# FROM MAIN COMPUTER
####################
# Create the sync directory in Dropbox
$ mkdir ~/Dropbox/sublime-text-3
# Move your ST3 "Packages" and "Installed Packages" to Dropbox
$ cd ~/Library/Application\ Support/Sublime\ Text\ 3
$ mv Packages/ ~/Dropbox/sublime-text-3
$ mv Installed\ Packages/ ~/Dropbox/sublime-text-3
@mimetaur
mimetaur / of_gitignore.txt
Last active October 22, 2017 13:54 — forked from brannondorsey/of_gitignore.txt
OpenFrameworks Project .gitignore
###########################
# ignore generated binaries
# but not the data folder
###########################
*/bin/*
!*/bin/data/
#########
# general
@mimetaur
mimetaur / guest.py
Created November 6, 2017 16:51
Dinner Table Guest from A.K. Dewdney's simulation
class Guest(object):
def __init__(self, name, index, x, y, ideal_distances):
self.name = name
self.index = index
self.x = x
self.y = y
self.target_x = x
self.target_y = y
self.ideal_distances = ideal_distances
self.presum = 0
@mimetaur
mimetaur / FindFood.cs
Created November 19, 2017 22:22
Food Search Algorithm
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class FindFood : MonoBehaviour
{
public Vector2 Search()
{
var foods = GameObject.FindGameObjectsWithTag("Food");