Skip to content

Instantly share code, notes, and snippets.

@jesseminn
jesseminn / machine.js
Last active August 31, 2020 15:38
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@jesseminn
jesseminn / machine.js
Created August 31, 2020 15:33
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
export function formatDate(date: any, delimiter: string = '/'): string {
const d: any = new Date(date);
if (isNaN(d.getTime())) {
console.error('`date` is not a valid date!');
return '';
} else {
return `${d.getFullYear()}${delimiter}${d.getMonth() + 1}${delimiter}${d.getDate()}`;
}
}
@jesseminn
jesseminn / .tmux.conf
Last active May 4, 2020 16:05
tmux configuration
# Set 256-color palette
# https://github.com/tmux/tmux/wiki/FAQ#how-do-i-use-a-256-colour-terminal
set -g default-terminal "screen-256color"
# Copy selected text to system clipboard
# 1. prefix [
# 2. move cursor to the start of the selection
# 3. press space bar to start select mode
# 4. move cursor around to make selection, then press enter to copy
bind -T copy-mode-vi Enter send-keys -X copy-pipe-and-cancel "pbcopy"
@jesseminn
jesseminn / .gitignore_global
Created August 29, 2017 06:51
Global .gitignore setting
# Reference #
# Gist from Octocat
# https://gist.github.com/octocat/9257657
#
# Tweets by CSSWizardry
# https://twitter.com/csswizardry/status/847029079622598656
#
# Discussion on Stackoverflow
# http://stackoverflow.com/questions/22924633/gitignore-is-not-ignoring-directories
#
@jesseminn
jesseminn / sass-strip-unit.css
Last active August 31, 2018 18:14
Sass strip unit function
/**
* @see https://codepen.io/MadeByMike/pen/LEJaRa
* @see https://madebymike.com.au/writing/precise-control-responsive-typography/
*/
:root {
font-size: 1024px;
line-height: 1.8;
}
@media screen and (max-width: 1024px) and (min-width: 321px) {
:root {
@jesseminn
jesseminn / media-queries.scss
Last active August 30, 2018 02:07
Sass media queries
/**
* @see https://jdsteinbach.com/sass/rwd-sass-media-queries/
* (This media query setting is for desktoptop-first design)
* (It might need adjustment for applying to mobile-first design)
*
* Generated by SassMeister.com
*/
$breakpoints: (
xl: 1440px,
lg: 1024px,
@jesseminn
jesseminn / .cvimrc
Last active August 30, 2018 02:19
cVIM configuration
" Reference:
" https://gist.github.com/marcusramberg/5761eff70d5dc49379f4
" https://gist.github.com/op/b0727c557983003da743
set smoothscroll
set autoupdategist " update gist every hour
set noautofocus " stop sites from focusing on an input box when they load
set typelinkhints " type text in the link to narrow down numeric hints
set scalehints " animate link hints as they appear
set linkanimations " show fade effect when link hints open and close