Skip to content

Instantly share code, notes, and snippets.

@frankfaustino
frankfaustino / install-arch.md
Last active September 20, 2022 19:03 — forked from mjnaderi/install-arch.md
Install Arch Linux with Full Disk Encryption (LVM on LUKS)

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@frankfaustino
frankfaustino / order.css
Created December 20, 2018 02:32
Ordering CSS Properties
/*
1. Layout Properties (position, float, clear, display)
2. Box Model Properties (width, height, margin, padding)
3. Visual Properties (color, background, border, box-shadow)
4. Typography Properties (font-size, font-family, text-align, text-transform)
5. Misc Properties (cursor, overflow, z-index)
*/
.example {
/* layout */
@frankfaustino
frankfaustino / GitCommitEmoji.md
Created December 19, 2018 05:48 — forked from parmentf/GitCommitEmoji.md
Git Commit message Emoji
@frankfaustino
frankfaustino / github-pr-template.md
Created November 19, 2018 05:55
GitHub Pull Request Template

Description

Please include a summary of the change and a link to which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Fixes # (issue)

Type of change

Please delete options that are not relevant.

@frankfaustino
frankfaustino / gradient.js
Created August 20, 2018 08:03
Generate Color Gradient
generateColor = (start, end, h, row) => {
const scale = row / h
const r = Math.round(
Math.min(255, Math.max(0, start.red + scale * (end.red - start.red)))
)
const g = Math.round(
Math.min(255, Math.max(0, start.green + scale * (end.green - start.green)))
)
const b = Math.round(
Math.min(255, Math.max(0, start.blue + scale * (end.blue - start.blue)))

About

Interpolating between things using lerp.

function lerp (start, end, t) {
  return start * (1 - t) + end * t;
}
@frankfaustino
frankfaustino / slim-redux.js
Created August 17, 2018 06:47 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
@frankfaustino
frankfaustino / thunks.js
Created July 30, 2018 01:49
thunk vs async thunk
/* —— thunks
* A nullary function (no arguments) that returns closured value(s).
* Basically a token or wrapper that represents a specific value.
*/
const add = (x, y) => x + y
const thunk = () => add(6, 3)
thunk() // 8
@frankfaustino
frankfaustino / React.html
Last active July 14, 2018 08:13
React.html
<html>
<body>
<div id="root"></div>
</body>
<script>
const rootEl = document.getElementById('root')
function createElement(type, props, ...children) {
const element = document.createElement(type)
Object.entries(props).forEach(([key, value]) => {