Skip to content

Instantly share code, notes, and snippets.

View sean-codes's full-sized avatar

Sean Codes sean-codes

View GitHub Profile
@sean-codes
sean-codes / streamlabs-chatbox.js
Created January 5, 2021 22:59
Streamlabs ChatBox Cute Colors
// makes streamlabs ChatBox username colors less saturated and brighter
document.addEventListener('onEventReceived', function(obj) {
const container = document.querySelector(`[data-id="${obj.detail.messageId}"]`);
const message = container.querySelector('.meta');
const colorString = message.style.color;
// never regex! ever! :]
const r = Number(colorString.split('(')[1].split(',')[0]);
const g = Number(colorString.split(',')[1].trim());
const b = Number(colorString.split(',')[2].split(')')[0].trim());
const {h, s, l} = rgbToHsl(r, g, b);
@sean-codes
sean-codes / utility-whitespace.scss
Created June 1, 2019 19:18
SCSS: utility classes for margin/padding
// whitespace
$whitespace: 1rem;
$whitespace-types: (
( 'short': p, 'long': padding ),
( 'short': m, 'long': margin )
);
$whitespace-directions: (
( 'name': t, 'prop': top ),
@sean-codes
sean-codes / init.coffee
Last active November 14, 2018 02:57
windows atom settings: automatic update by http://atom.io/packages/sync-settings
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@sean-codes
sean-codes / shuffle.js
Created July 4, 2018 08:39
shuffle array
var arr = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
function shuffle(arr) {
arr.forEach((ele, index) => {
var randomIndex = Math.floor(Math.random() * arr.length)
arr[index] = arr[randomIndex]
arr[randomIndex] = ele
})
return arr
var fakeSwitch = {
test0: function() {},
test1: function() {},
test2: function() {},
test3: function() {},
test4: function() {}
}
function testFakeSwitch(item) {
fakeSwitch[item]()
@sean-codes
sean-codes / stringPlate.cfc
Created January 31, 2018 18:15
Finds match/position between start and end characters
var demo = {
name: 'test',
func: function() {
return 'demo'
}
}
var string = '{{demo.description}} {({testdemo})}'
function stringPlate(str, data, startSymbol, endSymbol) {
@sean-codes
sean-codes / Tape Snippets
Last active January 15, 2018 03:55
Atom Snippets: Tape
# Your snippets
#
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to
# expand the prefix into a larger code block with templated values.
#
# You can create a new snippet in this file by typing "snip" and then hitting
# tab.
#
# An example CoffeeScript snippet to expand log to console.log:
#
@sean-codes
sean-codes / crazy.html
Created January 10, 2018 21:33
Recursive Top Nav Inner Menus
<nav>
<menu>
<menuitem><a>Home</a></menuitem>
<menuitem>
<a>More</a>
<menu>
<menuitem>
<a>Even More</a>
<menu>
<menuitem>
@sean-codes
sean-codes / autoladda.js
Created December 19, 2017 17:52
Auto Ladda Button with only 'ladda-button' class
j$(function(){
j$('.ladda-button').each(function(){
if(!j$(this).children('.ladda-label')){
j$(this).html('<span class="ladda-label">'+j$(this).html()+'</span>');
}
if(!j$(this).attr('data-style')){
j$(this).attr('data-style', 'slide-up');
}
});
@sean-codes
sean-codes / Generated CSS
Created November 9, 2017 20:34
Pure CSS Grid Lighting
This file has been truncated, but you can view the full file.
html, body{
background:#222;
margin:0;
padding:0;
height:100%;
}
body{