Skip to content

Instantly share code, notes, and snippets.

View RyanBreaker's full-sized avatar

Ryan Breaker RyanBreaker

View GitHub Profile
@RyanBreaker
RyanBreaker / .js
Last active July 24, 2019 00:44 — forked from joepie91/.js
"Breaking out" of a promises chain
/* Short answer: don't. Use conditional branches instead. See below. */
Promise.try(function(){
return someAsyncThing();
}).then( (value) => {
if (value === 3) {
return "final value";
} else {
return Promise.try( () => {
return someOtherAsyncThing();
@RyanBreaker
RyanBreaker / FlyCamera.cs
Last active November 27, 2023 04:40 — forked from gunderson/FlyCamera.cs
Unity Script to give camera WASD + mouse control
using UnityEngine;
using System.Collections;
public class FlyCamera : MonoBehaviour
{
/*
Writen by Windexglow 11-13-10. Use it, edit it, steal it I don't care.
Converted to C# 27-02-13 - no credit wanted.
Reformatted and cleaned by Ryan Breaker 23-6-18
@RyanBreaker
RyanBreaker / 0 - UNIX Fifth Edition.c
Created November 15, 2015 19:31
UNIX V5, OpenBSD, Plan 9, FreeBSD, and GNU coreutils implementations of echo.c
main(argc, argv)
int argc;
char *argv[];
{
int i;
argc--;
for(i=1; i<=argc; i++)
printf("%s%c", argv[i], i==argc? '\n': ' ');
}