Skip to content

Instantly share code, notes, and snippets.

View justyn-clark's full-sized avatar
🌬️

Justyn Clark justyn-clark

🌬️
View GitHub Profile
// Mine
@larger-than-mobile: ~"min-width: 400px";
@larger-than-phablet: ~"min-width: 550px";
@larger-than-tablet: ~"min-width: 768px";
@larger-than-desktop: ~"min-width: 1000px";
@larger-than-desktophd: ~"min-width: 1200px";
// Breakpoints
@highdensity: ~"only screen and (-webkit-min-device-pixel-ratio: 1.5)",
effect explanation
put dispatch an action to the redux store
select retrieve a part of the existing application state using selectors
call can call other sagas,Promises etc
take wait for an action to be dispatched
fork trigger a sub-process and move on without waiting for it to complete
cancel cancel the sub-process that has been forked
cancelled check if a current process has been cancelled
delay idles for the given period before moving to next statement, returns a Promise
;(function () {
/* ___ __ _ _ _ ____ ______ __
/ | _____/ /_(_) __(_)____(_)___ ____ / __ \________ __________ / ____/__ ____ / /____ _____
/ /| |/ ___/ __/ / | / / / ___/ / __ \/ __ \ / /_/ / ___/ _ \/ ___/ ___/ / / / _ \/ __ \/ __/ _ \/ ___/
/ ___ / /__/ /_/ /| |/ / (__ ) / /_/ / / / / / ____/ / / __(__ |__ ) / /___/ __/ / / / /_/ __/ /
/_/ |_\___/\__/_/ |___/_/____/_/\____/_/ /_/ /_/ /_/ \___/____/____/ \____/\___/_/ /_/\__/\___/_/ vanilla js
*/
@justyn-clark
justyn-clark / amdModule.js
Created January 18, 2018 23:02
AMD Module
;(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define(factory);
} else if (typeof exports === 'object') {
module.exports = factory();
} else {
root.JUSTYNCLARK = factory();
}
.aspect-ratio($width, $height) {
position: relative;
&:before {
display: block;
content: '';
width: 100%;
height: 0;
padding-top: ($height / $width) * 100%;
}
}
@justyn-clark
justyn-clark / classlessOOP.js
Last active February 11, 2024 20:45
classless OOP
function constructor(spec) {
let
{member} = spec,
{other} = other_constructor(spec),
method = function () {
// member, other, method, spec
};
return Object.freeze({
method,
other
@justyn-clark
justyn-clark / index.html
Last active February 11, 2024 20:45
JS SCSS Starter - A quick JS SCSS Starter Project
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>JS SCSS Starter</title>
<link rel="stylesheet" href="dist/style.css">
</head>
<body>
<script src="dist/scripts.js"></script>
</body>
@justyn-clark
justyn-clark / package.json
Last active February 11, 2024 20:45
ES6 JS - A quick JS starter project
{
"name": "js-starter",
"version": "1.0.0",
"description": "A quick JS starter project",
"main": "src/js/app.js",
"author": "Justyn Clark",
"license": "MIT",
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-preset-env": "^1.6.0",
// Example One
(function(){
var request;
if (window.XMLHttpRequest) {
request = new XMLHttpRequest();
} else {
request = new ActiveXObject("Microsoft.XMLHTTP");
}
request.onreadystatechange = function() {
@justyn-clark
justyn-clark / index.html
Last active February 11, 2024 20:45
Promises
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<button id="btn">Make a promise!</button>
<div id="log"></div>
<script src="scripts.js"></script>