Skip to content

Instantly share code, notes, and snippets.

Avatar
🤠
Howdy!

Zaydek zaydek

🤠
Howdy!
View GitHub Profile
View Todo.js
import { useEffect, useRef } from "react"
import useMethods from "use-methods"
const app = {
initialState: {
todo: "",
todos: [],
},
reducer: state => ({
setTodo(newTodo) {
View promise.ts
function check(fn: Function) {
try {
const ret = fn()
return [ret, null]
} catch (err) {
return [null, err]
}
}
async function checkAsync<T>(promise: Promise<T>) {
@zaydek
zaydek / input.scss
Created Dec 13, 2020
Generated by SassMeister.com.
View input.scss
@use "sass:string";
@use "sass:list";
@function replace($str, $s1, $s2) {
$n: string.index($str, $s1);
@return string.slice($str, 1, $n - 1) + $s2 + string.slice($str, $n + string.length($s1));
}
@mixin variants($variants...) {
@each $variant in $variants {
@zaydek
zaydek / input.scss
Created Dec 12, 2020
Generated by SassMeister.com.
View input.scss
@use "sass:string";
@function replace($str, $s1, $s2) {
$n: string.index($str, $s1);
@return string.slice($str, 1, $n - 1) + $s2 + string.slice($str, $n + string.length($s1));
}
@mixin variants($variants...) {
@each $variant in $variants {
@if $variant == core {
@zaydek
zaydek / input.scss
Created Dec 12, 2020
Generated by SassMeister.com.
View input.scss
@use "sass:string";
@function replace($str, $s1, $s2) {
$n: string.index($str, $s1);
@return string.slice($str, 1, $n - 1) + $s2 + string.slice($str, $n + string.length($s1));
}
@mixin variants($variants...) {
@each $variant in $variants {
@if $variant == core {
@zaydek
zaydek / input.scss
Created Dec 12, 2020
Generated by SassMeister.com.
View input.scss
@use "sass:string";
@mixin variants($variants...) {
@each $variant in $variants {
@if $variant == core {
@content;
} @else if $variant == hover {
@at-root {
.hover\:#{string.slice("" + &, 2)}:hover {
@content;
@zaydek
zaydek / input.scss
Created Dec 12, 2020
Generated by SassMeister.com.
View input.scss
@use "sass:string";
@mixin variants($variants...) {
@each $variant in $variants {
@if $variant == hover {
@at-root {
.hover\:#{string.slice("" + &, 2)}:hover {
@content;
}
}
View out.css
/*! duomo | MIT License | https://github.com/zaydek/duomo */
/* purgecss start ignore */
/*! modern-normalize v1.0.0 | MIT License | https://github.com/sindresorhus/modern-normalize */
/*
Document
========
*/
/**
Use a better box model (opinionated).
*/
@zaydek
zaydek / input.scss
Created Nov 29, 2020
Generated by SassMeister.com.
View input.scss
@function thing($str) {
@return $str;
}
@at-root {
.a {
top: thing(cap(8));
}
}
@zaydek
zaydek / input.scss
Created Nov 29, 2020
Generated by SassMeister.com.
View input.scss
@function thing($str) {
@return $str;
}
@at-root {
.a {
top: thing(cap(8));
}
}
You can’t perform that action at this time.