Skip to content

Instantly share code, notes, and snippets.

View JawsomeJason's full-sized avatar
💅
Bein' sassy

Jason Featheringham ⊙ω⊙ JawsomeJason

💅
Bein' sassy
View GitHub Profile
@JawsomeJason
JawsomeJason / delete-alexa-scenes.js
Created February 26, 2019 21:18
Delete all Alexa scenes
/* go to https://alexa.amazon.com/spa/index.html#scenes and paste this into the console */
Array.prototype.slice.call(document.querySelectorAll('.d-connected-home-link-btn')).map(el => el.getAttribute('appliance-id')).forEach(id => { console.log(id); fetch(`https://alexa.amazon.com/api/phoenix/appliance/${id}`, { method: 'DELETE' }) })
@JawsomeJason
JawsomeJason / viewport-fluid.less
Created October 20, 2018 20:49
LESS Mixin to easily create fluid typography based on viewport information
// see https://css-tricks.com/snippets/css/fluid-typography/ for 🤯
.viewport-fluid(@property, @from, @to, @screen-min: @screen-sm, @screen-max: @screen-lg, @viewport-unit: vw) {
@{property}: @from;
@media (min-width: @screen-min) {
@{property}: calc(
@from + unit(@to - @from) * ((~"100@{viewport-unit}" - @screen-min) / unit(@screen-max - @screen-min))
);
}
@JawsomeJason
JawsomeJason / colors.js
Last active May 21, 2018 06:07
List of colors with names.
/*
* Color names and values from http://chir.ag/projects/name-that-color/#6195ED
* rgb = Red, Green, Blue
* hsl = Hue, Saturation, Lightness
* hsv = Hue, Saturation, Value
* contrast = Readable contrast color via https://www.w3.org/TR/AERT/#color-contrast
* Y = Perceived Brightness
*/
const COLORS = {
@JawsomeJason
JawsomeJason / reset.css
Last active August 11, 2018 00:53
Minimal CSS reset
/* smallest reset ever */
*, *:before, *:after {
margin: 0;
padding: 0;
border: 0;
font: inherit;
vertical-align: baseline;
color: inherit;
box-sizing: inherit;
}
@JawsomeJason
JawsomeJason / spacing.css
Created May 20, 2018 10:14
Easy auto-spacing for HTML siblings
/*
* Automatically applies spacing to all non-inline siblings
* Disable in an element with `--SPACING-ENABLED: 0;`. Will automatically re-activate in children. Good for Grid Layout gap control.
* Change direction with `--SPACING-HORIZONTAL: 1`
*/
* {
margin: 0;
/* change this to 1 if you need to space it from it's previous sibling. */
--SPACING-ENABLED: 0;
@JawsomeJason
JawsomeJason / spacing.less
Created October 12, 2017 07:15
Consistent sibling spacing
/**
* super easy consistent spacing between all siblings
*
* usage:
* // in main.less
* :root {
* .consistent-spacing();
* }
*
* // somewhere you want to apply 32px vertical spacing
@JawsomeJason
JawsomeJason / !react-sublime-snippets.md
Last active September 6, 2017 17:18
Sublime Text Completions and Snippets for React
  • Place these in your Packages/User/Snippets folder
  • Use any of them with their tab trigger value.
  • call snippets using the first letter of each word plus the entire last word (e.g. rpch.. => react-proptypes-children.sublime-snippet
@JawsomeJason
JawsomeJason / gradient-overflow.less
Created June 6, 2017 04:58
create scrollable content with sticky gradient overlay on top and bottom
.gradient-overflow(@size: 24px, @color: white) {
// content will scroll if not enough space
overflow-y: auto;
// add a sticky gradient to the top and bottom of content
// it'll overlay over content if needed
&:before,
&:after {
content: '';
display: block;
@list: apple, satsuma, banana, pear;
.loop(@index) when (@index <= length(@list)) {
@item: extract(@list, @index);
.fruit-@{item} {
content: "Just a test.";
}
.loop(@index + 1);
}
.loop(1);
@JawsomeJason
JawsomeJason / _reset.scss
Created October 5, 2016 09:06
Most basic browser reset
// reset
* {
&,
&:before,
&:after {
font: inherit;
// -webkit-font-smoothing: antialiased;
// font-smoothing:antialiased;
text-rendering:optimizeLegibility;