Skip to content

Instantly share code, notes, and snippets.

View JEphron's full-sized avatar

Jordan Ephron JEphron

  • here and there
View GitHub Profile
@JEphron
JEphron / screeps.js
Created November 22, 2014 01:57
blah
var _ = require("lodash");
var harvestController = require("harvester");
var buildController = require("builder");
var guardController = require("guard");
var healerController = require("healer");
var spawnController = require("spawner");
var data = require("data");
// control creeps
@JEphron
JEphron / OptrexDisplay.ino
Created July 6, 2015 23:05
Some code for an Optrex PWB-16205b 2 line LCD character display
// tested with the PWB-16205b
// manual for the display: http://users.ece.utexas.edu/~valvano/Datasheets/LCDOptrex.pdf
int _rs = 12;
int _enable = 11;
int _d4 = 2;
int _d5 = 3;
int _d6 = 4;
int _d7 = 5;
@JEphron
JEphron / processing_camera.pde
Created December 10, 2015 02:25
An example of a following camera in procesisng
Camera2D cam;
Player player;
ArrayList<PVector> backgroundItems = new ArrayList<PVector>();
void setup() {
size(500, 500);
cam = new Camera2D(0, 0);
player = new Player(width/2, height/2);
for (int i = 0; i < 100; i++) {
backgroundItems.add(new PVector(random(-width, width*2), random(-height, height*2)));
@JEphron
JEphron / rc.txt
Created April 19, 2016 02:30
Open Github
alias github='open `git remote show origin | grep Fetch | sed -e '"'"'s/Fetch URL: //'"'"' -e '"'"'s/\.git//'"'"'`'
set-alias subl "C:\Program Files\Sublime Text 3\subl"
set-alias touch new-item
set-alias o explorer
set-alias ghub Github
set-alias gh Github
git config --global alias.lg "log --graph --abbrev-commit --decorate --format=format:'%C(bold white)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all"
git config --global alias.co checkout
git config --global alias.di diff
git config --global alias.br branch
git config --global alias.ci commit
[RPBroadcastActivityViewController loadBroadcastActivityViewControllerWithHandler:^(RPBroadcastActivityViewController *broadcastActivityViewController, NSError *error) {
broadcastActivityViewController.delegate = self;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
broadcastActivityViewController.modalPresentationStyle = UIModalPresentationPopover;
broadcastActivityViewController.popoverPresentationController.sourceRect = _broadcastButton.frame;
broadcastActivityViewController.popoverPresentationController.sourceView = _broadcastButton;
}
@JEphron
JEphron / Maybe.cs
Last active December 29, 2016 22:27
C# Option Types
using System;
namespace JME.Option
{
public class Maybe<T>
{
private readonly T _t;
private readonly bool _isSome;
public Maybe(T t)
@JEphron
JEphron / rule30.hs
Last active December 16, 2016 23:23
Rule 30
import Data.Maybe
import Data.List
import Data.Bits (bit, (.&.))
import Data.Map (fromList, (!))
import Control.Monad
import Graphics.Gloss
data Cell = Alive | Dead deriving (Eq, Ord)
instance Show Cell where
@JEphron
JEphron / CatmullRom2D.cs
Last active March 23, 2024 03:48
Catmull-Rom Spline Implementation
using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Encapsulates a Catmull Rom spline path
/// </summary>
/// todo: consider implementing the Centripedal Catmull Rom variation
public class CatmullRom2D
{
{
"type": "object",
"properties": {
"title": {
"type": "string"
},
"description": {
"type": "string"
},
"weight": {