Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sbrl's full-sized avatar

Starbeamrainbowlabs sbrl

View GitHub Profile
@sbrl
sbrl / README.md
Last active January 30, 2018 23:01
Aniframes.js - A minimal animation / game framework. Useful as a base for your own projects. #microlibrary

Aniframes.js

Aniframes.js is a quick library I have put together to help you create animations and / or games in javascript.

Note that the updater runs before the renderer.

Usage

var myGame = new aniframes(),
	canvas = document.querySelector("canvas");
myGame.set_canvas(canvas);
#!/bin/bash
#from https://gist.github.com/sbrl/4a642df930051575d91a
public=true
desc="(none)"
for i; do
case "$i" in
-p)
public=false
@sbrl
sbrl / nanoModal-position-text.html
Last active August 29, 2015 14:14
A test of kylepaulsen/NanoModal to demonstrate a positioning bug.
<!DOCTYPE html>
<html>
<head>
<title>nanoModal Test</title>
</head>
<body>
<h1>nanoModal Test</h1>
<p><strong>Scroll down and click the button</strong></p>
@sbrl
sbrl / valuevsreference.cs
Created February 5, 2015 09:59
A simple test of setting via value and setting via reference.
using System;
using System.Diagnostics;
class ValueVsReference
{
public static void SetValue(int somenumber, int maxi)
{
for (int i = 0; i < maxi; i++)
{
somenumber = i;
@sbrl
sbrl / explode_adv.php
Created May 21, 2015 10:09
Probably (not) the world's most advanced string splitting function.
<?php
/*******************************
* An advanced string splitting function written in PHP.
* Blog Post: https://starbeamrainbowlabs.com/blog/article.php?article=posts%2F077-PHP-String-Splittting.html
* Written by Starbeamrainbowlabs.
* Website: https://starbeamrainbowlabs.com
* Twitter: @SBRLabs
*/
function explode_adv($openers, $closers, $togglers, $delimiters, $str)
{
@sbrl
sbrl / localStorage.js
Last active January 30, 2018 23:02
[localStorage 4 node] localStorage for node.js & io.js #nodejs #microlibrary
/******************************************
* localStorage API for Node.js and io.js *
******************************************
* An implementation of the localStorage API for Node.JS and io.js. Currently untested.
******************************
* Written by Starbeamrainbowlabs <https://starbeamrainbowlabs.com/>
* I also wrote (and am upgrading!) Pepperminty Wiki: https://github.com/sbrl/pepperminty-wiki
*
* Gist link: https://gist.github.com/sbrl/ad69f6b22c36a1d5bcfe
* Posted to /r/tinycode here: (not posted yet!)
@sbrl
sbrl / first_test.js
Created June 2, 2015 11:43
ES6 Generators 1 Source Code used in a blog post.
function *first_test()
{
yield "Hello!";
yield "I am a generator!";
yield "This is the last thing I will yield.";
}
var test = first_test(),
next = test.next();
@sbrl
sbrl / maze.lua
Created June 24, 2015 19:47
A maze generation algorithm written in lua.
-------------------------------------
-- Maze generation script
-------------------------------------
-- A test by @Starbeamrainbowlabs
---------------------------------------------
-- Intelligent table printing function
---------------------------------------------
-- From http://coronalabs.com/blog/2014/09/02/tutorial-printing-table-contents/
@sbrl
sbrl / getch.py
Created June 25, 2015 13:32
A maze game written in Python
class _Getch:
"""Gets a single character from standard input. Does not echo to the
screen."""
def __init__(self):
try:
self.impl = _GetchWindows()
except ImportError:
self.impl = _GetchUnix()
def __call__(self): return self.impl()
@sbrl
sbrl / Worley.cs
Last active January 30, 2018 23:10
[Worley.cs] A Worley Noise Generator. https://youtu.be/50Kkl9l072g #algorithm #microlibrary
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
/*
* Worley noise generator, by Starbeamrainbowlabs
* License: Mozilla Public License 2.0
* License link: https://www.mozilla.org/en-US/MPL/2.0/
*
* Parts of this code were not written by Starbeamrainbowlabs. Credits are below: