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
@Bradshaw
Bradshaw / a8e.js
Last active March 6, 2021 12:04
a8e() - abbreviate everything!
let a8e = s=>s
.split(/([^a-zA-Z])/)
.map(s=>s.length>4 ? s[0]+(s.length-2)+s[s.length-1] : s)
.reduce((a,c)=>a+c)
a8e("abbreviate() for javascript: abbreviate everything!")
// ➡ a8e() for j8t: a8e e8g!
@Bradshaw
Bradshaw / 1. Ruffle.md
Last active January 17, 2021 08:16
A description of Ruffle - Kenku Nature Domain Cleric

The trees are a strange bunch. No patience for fools, yet here they were, telling Ruffle all their secrets.

Ruffle

  • Race: Kenku
  • Background: Hermit - Discovery
  • Class: Nature domain Cleric
  • Alignment: Chaotic Good
  • Personality traits: Isolated for so long that they rarely speak, preferring gestures and the occasional grunt.
    Oblivious to etiquette and social expectations.
  • Ideals: Greater Good. Their gifts are meant to be shared with all, not used for their own benefit.
@Bradshaw
Bradshaw / OneEuroExtensions.cs
Created November 28, 2014 10:18
Unity Implementation of the 1€ filter for input smoothing
using UnityEngine;
using System.Collections;
public struct FloatOneEuroData
{
public float dx;
public float edx;
public float cutoff;
public float filthatxprev;
public float dfilthatxprev;
@Bradshaw
Bradshaw / VectorExtensions.cs
Last active February 8, 2020 10:50
Quickly convert between various Vector2s and Vector3s
using UnityEngine;
public static class VectorExtensions {
public static Vector2 xy(this Vector3 v3)
{
return new Vector2(v3.x, v3.y);
}
public static Vector2 xz(this Vector3 v3)
{
@Bradshaw
Bradshaw / README.md
Last active January 17, 2020 16:53
Generic Score system for Unity & Node for use with https://generic-scores.glitch.me/

generic-scores

A simple high-score table with a database

Go to this Glitch.com project and select the "Remix on Glitch 🎤" option in the fish menu to set up the database & website server

Include ScorePoster.cs anywhere in your Unity project

Make sure to update the url and game key to point to your Glitch project

@Bradshaw
Bradshaw / TubeRenderer.cs
Created December 17, 2019 13:38
Kinda broken tube renderer thing
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(MeshFilter))]
[RequireComponent(typeof(MeshRenderer))]
public class TubeRenderer : MonoBehaviour {
public List<Vector3> positions;
public int positionCount {
@Bradshaw
Bradshaw / main.lua
Last active September 17, 2019 11:23
Simple fudge for löve usage
function love.load(arg)
-- Include Fudge
fudge = require("fudge")
-- Create new texture pack from folder "gfx"
f = fudge.new("gfx")
-- Set the current texture pack (for monkeypatched love.graphics.draw)
fudge.current = f
@Bradshaw
Bradshaw / parseWebring.js
Last active July 5, 2019 13:55
Example of how to parse XXIIVV webring sites.js file
const request = require('request')
const gatherSiteObjects = () => {
return new Promise((resolve, reject) => {
request('https://webring.xxiivv.com/data/sites.json', (err, _, body) => {
if (!err) {
const siteObjects = JSON.parse(body)
resolve(siteObjects)
} else reject(err)
})
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NicknameGenerator : MonoBehaviour
{
public TextAsset examples;
public int segmentLength = 3;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Maze : MonoBehaviour
{
Node[,] maze;
public int width;
public int height;