Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
Howdy!

Zaydek zaydek

🤠
Howdy!
View GitHub Profile
@zaydek
zaydek / input.scss
Created Nov 28, 2020
Generated by SassMeister.com.
View input.scss
@use "sass:string";
@mixin responsive {
@each $key, $n in (sm: 640, md: 768) {
/* >= #{$n + px} (#{$key}) */
@media (min-width: $n + px) {
.#{$key} {
@content;
}
}
@zaydek
zaydek / output
Last active Nov 5, 2020
Idea for generated light mode / dark mode CSS
View output
body {
--primary-text: #fff;
--primary-bg: #fff;
--secondary-text: #aaa;
--secondary-bg: #aaa;
--tertiary-text: #fff;
--tertiary-bg: #fff;
}
body[data-theme=dark], body [data-theme=dark] {
@zaydek
zaydek / input.scss
Created Nov 5, 2020
Generated by SassMeister.com.
View input.scss
@function semantic($str) {
@if $str == "color" {
@return "text";
} @else if $str == "background-color" {
@return "bg";
} @else if $str == "box-shadow" {
@return "shadow";
}
@return $str;
}
@zaydek
zaydek / input.scss
Created Oct 14, 2020
Generated by SassMeister.com.
View input.scss
$breakpoints: (
"xs": 640,
"sm": 768,
"md": 896,
"lg": 1024,
"xl": 1280,
);
// prettier-ignore
$pxs:
@zaydek
zaydek / input.scss
Created Oct 14, 2020
Generated by SassMeister.com.
View input.scss
$breakpoints: (
"xs": 640,
"sm": 768,
"md": 896,
"lg": 1024,
"xl": 1280,
);
// prettier-ignore
$pxs:
View xstate.js
const booleanMachine = Machine({
id: "bool",
initial: "false",
states: {
false: {
on: {
TOGGLE: "true",
},
},
true: {
View machine.js
const MAX_ALLOWABLE_ATTEMPTS = 3
const userLoginMachine = Machine({
id: "userLogin",
initial: "loginScreen",
context: {
authError: "",
attemptCount: 0,
},
states: {
View machine.js
const MIN_ATTEMPTS = 5
const attemptsDelayedRefetchForeverMachine = Machine({
id: "attemptsDelayedRefetchForever",
initial: "fetching",
context: {
numberOfAttempts: 0,
},
states: {
fetching: {
View machine.js
const delayedTransientRefetchForeverMachine = Machine({
id: "delayedTransientRefetchForever",
initial: "fetching",
states: {
fetching: {
invoke: {
id: "fetchHandler",
src: (ctx, e) => new Promise((resolve, reject) => {
setTimeout(() => {
reject()
View machine.js
const refetchForeverMachine = Machine({
id: "refetchForever",
initial: "fetching",
states: {
fetching: {
invoke: {
id: "fetchHandler",
src: (ctx, e) => new Promise((resolve, reject) => {
setTimeout(() => {
// if (Math.random() < 0.5) {
You can’t perform that action at this time.