Skip to content

Instantly share code, notes, and snippets.

Avatar
💜
Doing something

Jacob Foster AlcaDesign

💜
Doing something
View GitHub Profile
View profile.json
{"version":2,"type":"profile","profile":{"id":7,"name":"Coding Garden","hotkey":null,"pause_updates":null,"description":"Commands for CodingGarden","context":[{"id":"5b66b0d5-0d11-4d41-af47-4d4ef92047db","type":"Channel","data":{"login":"codinggarden","id":"413856795"}}]},"toggled":true,"values":{"chat.actions.room":[{"t":"inherit","id":"1657045451549-0.39029851003637184-0"},{"v":{"action":"chat","appearance":{"type":"image","text":"Topic","image":"https://sfo2.digitaloceanspaces.com/alca/static/f/cj/Timer_Start_opt.png","tooltip":"!focus-start"},"options":{"command":"!focus-start 30","paste":true},"display":{}},"id":"1657042750748-0.43892151947400904-0"},{"v":{"action":"chat","appearance":{"type":"image","text":"Topic","image":"https://sfo2.digitaloceanspaces.com/alca/static/f/cj/Timer_Stop_opt.png","tooltip":"!focus-end"},"options":{"command":"!focus-end","paste":false},"display":{}},"id":"1657047049848-0.7201918069457542-1"}]}}
@AlcaDesign
AlcaDesign / main.js
Last active May 2, 2022
An example for tracking mystery gift subs - https://github.com/tmijs/tmi.js/discussions/515
View main.js
/**
* How long to wait in milliseconds if Twitch is taking too long to respond with
* all of the gifts.
*/
const MYSTERYGIFT_TIMEOUT_MS = 10 * 1000;
/**
* How long to wait in milliseconds if the detected gift sub is not part of a
* larger mystery gift initially.
*/
const GIFTSUB_ORPHAN_TIMEOUT_MS = 2 * 1000;
@AlcaDesign
AlcaDesign / custom-events.js
Created Feb 10, 2019
Custom USERNOTICE events, ahead of 1.4.0. (Examples included in `index.js`)
View custom-events.js
const tmiParse = require('tmi.js/lib/parser');
const escapedIRCRegex = /\\([sn:r\\])/g;
const ircEscapedChars = { s: ' ', n: '', ':': ';', r: '' };
const booleanTagKeys = [ 'mod', 'subscriber', 'msg-param-should-share-streak' ];
const integerTagKeys = [
'tmi-sent-ts', 'msg-param-months', 'msg-param-cumulative-months',
'msg-param-streak-months', 'msg-param-sender-count',
'msg-param-mass-gift-count', 'msg-param-viewerCount', 'msg-param-threshold',
'msg-param-bits-amount', 'msg-param-min-cheer-amount',
@AlcaDesign
AlcaDesign / chat-lines-tweaks.css
Last active Apr 29, 2018
Alca's custom CSS for modch.at (https://modch.at) | Sections are separated into files and "modch.at-custom.css" is all of them together.
View chat-lines-tweaks.css
.chat-lines {
font-size: 14px;
}
View Rose.pde
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(
View TwitchAPI.js
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 StarPatterns.pde
float sliderA, sliderB;
float dim = 20;
void setup() {
size(600, 600);
sliderA = random(0, dim);
sliderB = random(0, dim * 2);
}
void draw() {
@AlcaDesign
AlcaDesign / DistToSegment_sketch.pde
Last active Jan 22, 2017
Animation to show how a distance of a point to a line segment looks. Ref: http://stackoverflow.com/a/1501725
View DistToSegment_sketch.pde
PVector lineStart, lineEnd, point;
void setup() {
size(600, 600);
updatePoints();
}
void draw() {
background(0);
View MysticRose_3D_sketch.pde
PVector[] points;
int pointCount = 0;
int lastPointCount = 0;
void setup() {
size(600, 600, P3D);
colorMode(HSB);
}
void draw() {
@AlcaDesign
AlcaDesign / DOMAugmentedCanvas-p5-ES2015.html
Last active Jan 22, 2017
DOM Augmented Canvas with P5.js
View DOMAugmentedCanvas-p5-ES2015.html
<!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;