Skip to content

Instantly share code, notes, and snippets.

View markodayan's full-sized avatar
🍑

Mark Odayan markodayan

🍑
View GitHub Profile
@markodayan
markodayan / package.json
Last active April 22, 2020 21:30
Webpack configs
{
"name": "chapter-19",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"build": "node_modules/.bin/webpack --mode production",
"serve": "webpack-dev-server --mode development"
},
"author": "",
@markodayan
markodayan / .babelrc
Last active April 22, 2020 21:29
Babel and Modern JS Builds
{
"presets": ["@babel/preset-env"]
}
@markodayan
markodayan / endpoints.txt
Last active April 18, 2020 19:46
COVID-19 Data
https://corona.lmao.ninja/v2/countries [all]
axios.get(`https://corona.lmao.ninja/v2/countries/${countryName}`) [Query By Country]
eg -> https://corona.lmao.ninja/v2/countries/south%20africa
@markodayan
markodayan / ts-react.sh
Created April 12, 2020 21:30
create-react-app with TypeScript
npx create-react-app <app_name> --typescript
Caps+fn+p (6 secs) = Capital Key RGB Independance
fn + K + C -> Disable brightness buttons to allow F5 and F6 Func
@markodayan
markodayan / cdn.html
Created March 28, 2020 11:45
CDNs I am lazy to keep googling
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css"
integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
@markodayan
markodayan / useFetch.js
Created March 6, 2020 11:40
Custom HTTP request using custom React hook
import { useEffect, useState } from 'react';
export const useFetch = url => {
const [info, setInfo] = useState({ data: null, loading: true });
useEffect(() => {
setInfo({ data: null, loading: true });
fetch(url)
.then(x => x.text())
.then(y => {
@markodayan
markodayan / useForm.js
Created March 5, 2020 21:33
Custom Hooks in React (Form Input State Management)
import { useState } from 'react';
export const useForm = initialValues => {
const values, setValues[ = useState(initialValues);
return [
values,
e => {
setValues({
...values,
@markodayan
markodayan / useForm.js
Last active March 5, 2020 21:59
Custom Hooks in React (Form Input State Management)
import { useState } from 'react';
export const useForm = initialValues => {
const [values, setValues] = useState(initialValues);
return [
values,
e => {
setValues({
...values,
@markodayan
markodayan / dev-resources.txt
Created February 25, 2020 19:55
Developer Resources and Useful References
www.easings.net [CSS Animation and Transition Timing Functions]
caniuse.com [CSS Feature compatibility with browsers]
mydevice.io [Device screen resolution pixel conversions]
shouldiprefix.com [Future proofing CSS]
sass-lang.com [sass documentation]