Skip to content

Instantly share code, notes, and snippets.

View Bradshaw's full-sized avatar
🚀
Lost in space

Gaeel Bradshaw-Rodriguez Bradshaw

🚀
Lost in space
View GitHub Profile
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
#define PIN 7
#define NUMPIXELS 100
#define POWER 255
float pos = 0;
@Bradshaw
Bradshaw / iterateCoroutine.js
Last active December 18, 2017 07:37
Iterate a "coroutine"
function iterateCoroutine(next, skipTime, pauseTime) {
var skipTime = skipTime ? skipTime : 1000/60;
var pauseTime = pauseTime ? pauseTime : 0;
var start = Date.now();
while (Date.now()-start<skipTime){
var next = next();
if (!next)
return false;
}
if (pauseTime>0){
// Arary stuff
// ⚠️ = destructive
// To use destructive methods without breaking the original array do a Array.clone() first
// 👉 = Composable
// You can chain these methods together as they'll return the Array, like:
// [1,2,3,3,3,2,2,4,5].removeFirst(3).removeAll(2) -> [1, 3, 3, 4, 5]
// 👉 Copies an Array
// This is a shallow copy, it does not create copies of the contents

Boom💣 2➕ plus 2 is 4 Minus➖ 1 that's 3, quick maths🔢 Everyday man's on the block, smoke trees💨🌲 See your girl👧 in the park🏞️, that girl is a uckers When the ting🔫 went quack-quack-quack🦆, you man were ducking🐥 Hold tight Asnee, he's got the pumpy🔫 Hold tight my man, he's got the frisbee⚽ I trap, trap, trap on the road🚗, movin' that cornflakes🍲 Rice Krispie, hold tight my girl Whitney🙎🏿‍♀️ (perfect)💯 On the road doin' ten tours, allow my toes👣 You man thought I froze❄️ I see a peng girl then I pose If she's not on it, I ghost👻😱 Hah, look at your nose👃👃 What? You dickhead!❎❎ Look at your nose🐽🐽 Nose run like garden hose,💦💦💦 shhh, you get me? Aight, boom💣 Let's go, boom💣 Hop out the four door with the .44🔫 It was 1, 2, 3 and 4🔢🔢 Chillin' in the corridor, your dad is 44👨‍👩‍👧 And he's still callin' man for a draw🃏 Let him know, when I see him, I'm gonna spin his jaw👄 Take man Twix by force🍫🍫 Send man shop by force🏬 Your girl knows I've got the sauce, no ketchup🌭🌭 Just sauce, raw sauce Boom, yo, gah💣 The ting goes

@Bradshaw
Bradshaw / resume.md
Created October 19, 2017 13:46
Resume
@Bradshaw
Bradshaw / conway's mistake.js
Last active October 8, 2017 16:43
Code for a [Gooey Bot](https://gaeel.itch.io/gooey-bot) that does Conway's Game of Life
// Array of booleans that contains current frame state
var conwarray = [];
// Previous frame state
var old = [];
// Dimensions
var width = 6;
var height = 11;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public enum PlayMode {
Toggle,
Trigger
}
[RequireComponent(typeof(AudioClip))]
@Bradshaw
Bradshaw / .SubmitBasicAuth.MD
Last active September 12, 2017 12:44
SubmitBasicAuth: A simple method for updating Rotonde feeds

Bradshaw/SubmitBasicAuth provides a method for updating Rotonde feeds through a simple HTTP POST request with Basic Access Authentication

The path provides a path to which a POST request may be made.   Content-Type should be set to application/json.
Authentication is done through base64(username:password) sent in the authentication header like: Authorization: Basic QWxhZGRpbjpPcGVuU2VzYW1l

Included below is an example JSON-formatted string to send in POST data  

Ensure you have applied the correct CORS settings on your server to allow posts and authentication.

@Bradshaw
Bradshaw / SinglePost.MD
Created September 11, 2017 08:59
SinglePost: Spec for retrieving a single post from a Rotonde feed

Bradshaw/SinglePost provides a simple route to retrieve a modified Rotonde feed that contains only one post.

The path field provides a path like /by-id/:id, by replacing :id with the id of a post found in the full rotonde field and appending this path, the server should respond with a Rotonde-compatible JSON containing only one item in the feed

If there are no posts with the given id, respond with a 404
If there are multiple posts with the given id, or there is some other error, respond with a 500

Gaeel@retribution [12:53][😡 ][master]
blastaway $> ~/dev/stuff/capsule/build/dist/capsulerun -- "electron game/main.js"
[capsulerun] thanks for flying capsule on macOS
[capsulerun] Running from: /Users/Gaeel/dev/stuff/capsule/build/dist/capsulerun
[capsulerun] Library path: /Users/Gaeel/dev/stuff/capsule/build/dist
[capsulerun] Pipe name: capsule
[capsulerun] Could not access executable (error -1): Unknown error: -1
[capsulerun] Couldn't start child, bailing out
Gaeel@retribution [12:53][😡 ][master]