Skip to content

Instantly share code, notes, and snippets.

View zaydek's full-sized avatar
🀠
Howdy!

Z πŸ΄β€β˜ οΈ zaydek

🀠
Howdy!
View GitHub Profile
// styled component version
const Container = styled.div`
/*all of the styles*/
`
function MyComponent() {
return <Container>{/*other stuff*/}</Container>
}
// css prop version
import { useEffect, useReducer } from 'react';
type State<TState, TEffect> = TState & {
effects?: TEffect[];
};
export type UseFsmReducerEffects<TAction, TEffect extends { type: string }> = {
[K in TEffect['type']]: (params: {
effect: Extract<TEffect, { type: K }>;
dispatch: (action: TAction) => void;
@simsketch
simsketch / pokemon.csv
Last active February 26, 2024 16:01
pokemon.csv
NUMBER CODE SERIAL NAME TYPE1 TYPE2 COLOR ABILITY1 ABILITY2 ABILITY HIDDEN GENERATION LEGENDARY MEGA_EVOLUTION HEIGHT WEIGHT HP ATK DEF SP_ATK SP_DEF SPD TOTAL
1 1 11 Bulbasaur Grass Poison Green Overgrow Chrolophyll 1 0 0 0.7 6.9 45 49 49 65 65 45 318
2 1 21 Ivysaur Grass Poison Green Overgrow Chrolophyll 1 0 0 1 13 60 62 63 80 80 60 405
3 1 31 Venusaur Grass Poison Green Overgrow Chrolophyll 1 0 0 2 100 80 82 83 100 100 80 525
3 2 32 Mega Venusaur Grass Poison Green Thick Fat 1 0 1 2.4 155.5 80 100 123 122 120 80 625
4 1 41 Charmander Fire Red Blaze Solar Power 1 0 0 0.6 8.5 39 52 43 60 50 65 309
5 1 51 Charmeleon Fire Red Blaze Solar Power 1 0 0 1.1 19 58 64 58 80 65 80 405
6 1 61 Charizard Fire Flying Red Blaze Solar Power 1 0 0 1.7 90.5 78 84 78 109 85 100 534
6 2 62 Mega Charizard X Fire Dragon Black Tough Claws 1 0 1 1.7 110.5 78 130 111 130 85 100 634
6 3 63 Mega Charizard Y Fire Flying Red Drought 1 0 1 1.7 90.5 78 104 78 159 115 100 634
@iansu
iansu / README.md
Last active March 1, 2021 08:40
Create React App 4.0 Alpha Testing

Create New App

JavaScript Template

npx create-react-app@next --scripts-version=@next --template=cra-template@next my-js-app

TypeScript Template

npx create-react-app@next --scripts-version=@next --template=typescript@next my-ts-app

@mattpocock
mattpocock / machine.js
Created July 28, 2020 08:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@hihayk
hihayk / dynamic-line-height.css
Created July 7, 2020 17:05
Dynamically decrease line-height as the font-size grows.
:root {
--lineHeightFixedAmount: 0.25rem;
--lineHeightRelativeAmount: 1em;
--sizesIncrement: 1.4;
--fontSize-0: 1rem;
--fontSize-1: calc(var(--fontSize-0) * var(--sizesIncrement));
--fontSize-2: calc(var(--fontSize-1) * var(--sizesIncrement));
--globalLineHeight: calc(var(--lineHeightFixedAmount) + var(--lineHeightRelativeAmount));
@graphicbeacon
graphicbeacon / main.dart
Last active September 17, 2021 01:46
Solution code on "Flutter for React developers" YouTube tutorial
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:math' as math;
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@danestves
danestves / aspect.css
Created February 13, 2020 22:53
Aspect Radios to use with tailwindcss
.embed-responsive {
@apply relative;
}
.embed-responsive::before {
@apply block;
content: "";
}
.embed-responsive .embed-responsive-item,
@antfu
antfu / πŸ“Š Weekly development breakdown
Last active November 20, 2023 10:25
πŸ“Š Weekly development breakdown
TypeScript 21 hrs 47 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘ 67.1%
Vue.js 6 hrs 21 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–“β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 19.6%
JSON 2 hrs 10 mins β–ˆβ–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 6.7%
JavaScript 46 mins β–ˆβ–ˆβ–ˆβ–’β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.4%
package main
import (
"context"
"database/sql"
"encoding/base64"
"encoding/json"
"fmt"
"time"