Skip to content

Instantly share code, notes, and snippets.

View loktar00's full-sized avatar
🏠
Working from home

Jason loktar00

🏠
Working from home
View GitHub Profile
// code updates are now there:
// https://github.com/Bleuje/processing-animations-code/blob/main/code/hilbertcurvetransforms/hilbertcurvetransforms.pde
// Processing code by Etienne JACOB
// motion blur template by beesandbombs
// CC BY-SA 3.0 license because it's using code from Wikipedia
// View the rendered result at: https://bleuje.com/gifanimationsite/single/hilbertcurvetransforms/
int[][] result;
float t, c;
@rlemon
rlemon / bulk-trash.js
Last active July 23, 2017 20:34
Bulk Trash
var btn = $('<button class="button">Bulk Trash</button>'),
room = document.forms[0].elements.room.value;
btn.on('click', function() {
var modal = $('<div><h4>Trash Who?</h4></div>'),
$users = $('#present-users:not(.more)').clone();
modal.append($users).addClass('popup room-popup').css({
bottom: btn.position().top,
left: btn.position().left
}).on('click', function(e) {
if (confirm("Would you like to trash all posts by " + e.target.title)) {
@gre
gre / list.md
Last active September 18, 2015 21:29
greweb's Top 20 of JS13K 2015 games (VERY subjective. I've used LD categories to establish a score. and sorted the list (left right, top down) )
@AmaanC
AmaanC / JS13k.md
Created September 13, 2015 15:41
A list of SO Chat's JS13k submissions
@rlemon
rlemon / user-stars.es6.js
Created August 26, 2015 02:10
user stars
let io = undefined, found = [];
const addScript = url => {
return new Promise((resolve, reject) => {
let script = document.createElement('script');
script.onload = resolve;
script.onerror = reject;
script.src = url;
document.body.appendChild(script);
});
};
@rlemon
rlemon / delete.babel.js
Last active August 29, 2015 14:28
delete button to user popup
const room = document.forms[0].elements.room.value;
const parseNode = node => {
if (node.classList && node.classList.contains('popup')) {
if( node.parentNode && node.parentNode.classList && node.parentNode.classList.contains('message') ) { // this is probably overkill.
addButton(node);
}
}
};
const addButton = node => {
let elm = document.createElement('a');
const parseNode = (node) => {
if( node.classList && node.classList.contains('user-container') ) {
let meta = node.querySelectorAll('.meta');
[].forEach.call(meta,m=>{
let del = document.createElement('span');
del.textContent = 'x';
del.classList.add('vote-count-container');
del.style.cursor = 'pointer';
del.onclick = function() { // fuck you I want `this`
let id = this.parentNode.parentNode.id.split('-')[1];
@srolel
srolel / 1 Topics.md
Last active August 29, 2015 14:19
April Javascript Room Meeting

This document will list the subjects for the upcoming room meeting, scheduled for 2015-04-25.

Feel free to suggest topics in the comment section.

Topic List

  1. subscription to javascript tag on codereview.stackexchange.com
  2. Assigning people to execute room meeting (or other) conclusions.
  3. Contributors to room rules.
  4. Rss feeds.
@rlemon
rlemon / webminline.js
Last active August 29, 2015 14:18
webm inline player for so chat
(function() {
"use strict";
function parseNode(node) {
if (node.classList && node.classList.contains('message') && !node.classList.contains('pending')) {
var content = node.querySelector('.content');
if ([].filter.call(content.childNodes, function(child) {
return (child.nodeType === 1 || child.nodeType === 3)
}).length > 1) return; // shut up
var link = content.querySelector('a');

Folder Structure

Please note

While this gist has been shared and followed for years, I regret not giving more background. It was originally a gist for the engineering org I was in, not a "general suggestion" for any React app.

Typically I avoid folders altogether. Heck, I even avoid new files. If I can build an app with one 2000 line file I will. New files and folders are a pain.