View compact.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var input = 'Now, this is a story all about how My life got flipped-turned upside down And I\'d like to take a minute Just sit right there I\'ll tell you how I became the prince of a town called Bel Air', | |
endLength = 165; | |
function rangeMap(n, in_min, in_max, out_min, out_max) { | |
return (n - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; | |
} | |
function rangeMapFloor(n, a, b, c, d) { | |
return Math.floor(rangeMap(n, a, b, c, d)); | |
} |
View index.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const _ = require('lodash'), // Just to handle a couple of things more easily | |
tmi = require('tmi.js'), | |
channel = ''; // Your channel | |
let mainConfig = { | |
options: { | |
debug: true // Debug to console |
View Logger.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ascii colors in console | |
function colorize(id, ...text) { | |
return `\u001b[${id}m${text.join()}\u001b[39m`; | |
} | |
// The brightest white text | |
function whiteBright(...text) { | |
return colorize(97, ...text); | |
} | |
// The brightest white text | |
function blackBright(...text) { |
View Entity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Entity { | |
PVector size = new PVector(entitySize, entitySize); | |
PVector pos = new PVector(0, 0); | |
PVector vel = new PVector(0, 0); | |
PVector acc = new PVector(0, 0); | |
color c; | |
boolean bounced = false; | |
int life = 0; | |
int lifeSpan = 200; | |
View DOMAugmentedCanvas-p5-ES2015.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>DOM Augmented Canvas - ES2015</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.6/p5.min.js"></script> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.5.6/addons/p5.dom.min.js"></script> | |
<style> | |
html, | |
body { | |
margin: 0; |
View DistToSegment_sketch.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PVector lineStart, lineEnd, point; | |
void setup() { | |
size(600, 600); | |
updatePoints(); | |
} | |
void draw() { | |
background(0); | |
View MysticRose_3D_sketch.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PVector[] points; | |
int pointCount = 0; | |
int lastPointCount = 0; | |
void setup() { | |
size(600, 600, P3D); | |
colorMode(HSB); | |
} | |
void draw() { |
View StarPatterns.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
float sliderA, sliderB; | |
float dim = 20; | |
void setup() { | |
size(600, 600); | |
sliderA = random(0, dim); | |
sliderB = random(0, dim * 2); | |
} | |
void draw() { |
View TwitchAPI.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const request = require('request'), | |
_kraken = request.defaults({ | |
baseUrl: 'https://api.twitch.tv/kraken/', | |
headers: { | |
'Client-ID': 'CLIENT ID HERE', | |
Accept: 'Accept: application/vnd.twitchtv.v5+json' | |
}, | |
json: true | |
}); |
View Rose.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Rose { | |
PShape shape; | |
PVector stemStart, stemEnd; | |
float targetStemLength, growthTimeStart, growthTimeEnd; | |
float n, d, targetR, r; | |
float i; | |
Rose(int index) { | |
stemStart = new PVector( | |
random( |
OlderNewer