Transition property
div {
transition: [property] [duration] [timing-function] [delay];
}
// Run this file to cause an `unhandledRejection` infinite loop | |
// > node index.js | |
// 2. Catch first unhandled promise rejection | |
// 4. Catch error inside unhandledRejection, causing an infinite loop | |
process.on('unhandledRejection', (reason, p) => { | |
console.log('Unhandled Rejection at:', p, 'reason:', reason); | |
new Promise(() => { | |
const b = {}; |
const GITHUB_TEAM_API_URL_PREFIX = 'https://api.github.com/repos/SOME_TEAM'; | |
const githubArchiveUrl = ({ repoName, branch }) => | |
`${GITHUB_TEAM_API_URL_PREFIX}/${repoName}/tarball/${branch}`; | |
const getGithubArchiveRedirectUrl = ({ repoName, branch, githubToken }) => { | |
const url = githubArchiveUrl({ repoName, branch }); | |
return fetch(url, { | |
headers: { | |
Authorization: `token ${githubToken}` |
Matches: from:(github.com) subject:(ORG_NAME) | |
Do this: Skip Inbox, Apply label "github" | |
Matches: from:(notifications@github.com) to:(EMAIL) | |
Do this: Apply label "github/me", Categorise as Personal | |
where, | |
ORG_NAME = Github organisation name | |
EMAIL = Github email address |
import React from "react"; | |
import { Provider, Subscribe, Container } from "unstated"; | |
import ApiService from './utils/api-service'; | |
const DEFAULT_STATE = { | |
loggedIn: false, | |
user: {}, | |
errors: [] | |
}; |
How to add custom fonts to a webpage:
Generate web fonts for every browser eg, use https://www.fontsquirrel.com/tools/webfont-generator or https://transfonter.org/
Add fonts to css/fonts
folder or equivalent
Look inside downloaded font files for a stylesheet.css
or equivalent and copy the @font-face
, while adjusting the file paths to match the location of the font folder
@font-face {
font-family: "Some font";
src: url("css/fonts/some-font.eot");
src: url("css/fonts/some-font.woff") format("woff"),
A quick cheatsheet for flexbox
.
For a more detailed cheatsheet see something like: https://yoksel.github.io/flex-cheatsheet/.
.parent {
display: [flex|inline-flex];
/* Change direction */
flex-direction: [row|row-reverse|column|column-reverse];
#!/bin/bash | |
# | |
# Usage: | |
# | |
# Find all files | |
# | |
# ls -1 $PWD/*.js > files.txt | |
# | |
# Run script | |
# |
# Your snippets | |
# | |
# Atom snippets allow you to enter a simple prefix in the editor and hit tab to | |
# expand the prefix into a larger code block with templated values. | |
# | |
# You can create a new snippet in this file by typing "snip" and then hitting | |
# tab. | |
# | |
# An example CoffeeScript snippet to expand log to console.log: | |
# |