Skip to content

Instantly share code, notes, and snippets.

Avatar

Sean Codes sean-codes

View GitHub Profile
@sean-codes
sean-codes / Generated CSS
Created Nov 9, 2017
Pure CSS Grid Lighting
View Generated CSS
This file has been truncated, but you can view the full file.
html, body{
background:#222;
margin:0;
padding:0;
height:100%;
}
body{
@sean-codes
sean-codes / autoladda.js
Created Dec 19, 2017
Auto Ladda Button with only 'ladda-button' class
View autoladda.js
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 / crazy.html
Created Jan 10, 2018
Recursive Top Nav Inner Menus
View crazy.html
<nav>
<menu>
<menuitem><a>Home</a></menuitem>
<menuitem>
<a>More</a>
<menu>
<menuitem>
<a>Even More</a>
<menu>
<menuitem>
@sean-codes
sean-codes / Tape Snippets
Last active Jan 15, 2018
Atom Snippets: Tape
View Tape Snippets
# 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 / stringPlate.cfc
Created Jan 31, 2018
Finds match/position between start and end characters
View stringPlate.cfc
var demo = {
name: 'test',
func: function() {
return 'demo'
}
}
var string = '{{demo.description}} {({testdemo})}'
function stringPlate(str, data, startSymbol, endSymbol) {
View fake switch
var fakeSwitch = {
test0: function() {},
test1: function() {},
test2: function() {},
test3: function() {},
test4: function() {}
}
function testFakeSwitch(item) {
fakeSwitch[item]()
View shuffle.js
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
@sean-codes
sean-codes / init.coffee
Last active Nov 14, 2018
windows atom settings: automatic update by http://atom.io/packages/sync-settings
View init.coffee
# 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 / utility-whitespace.scss
Created Jun 1, 2019
SCSS: utility classes for margin/padding
View utility-whitespace.scss
// whitespace
$whitespace: 1rem;
$whitespace-types: (
( 'short': p, 'long': padding ),
( 'short': m, 'long': margin )
);
$whitespace-directions: (
( 'name': t, 'prop': top ),
@sean-codes
sean-codes / streamlabs-chatbox.js
Created Jan 5, 2021
Streamlabs ChatBox Cute Colors
View streamlabs-chatbox.js
// 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);