Skip to content

Instantly share code, notes, and snippets.

View crittelmeyer's full-sized avatar

Chris Rittelmeyer crittelmeyer

  • Olive
  • Atlanta, GA
View GitHub Profile
@crittelmeyer
crittelmeyer / PixelWorldMap.tsx
Created January 30, 2022 20:58
An animated world map component made of CSS box-shadow "pixels" (based on https://pokecoder.hashnode.dev/making-pixel-art-with-pure-css)
import { keyframes } from 'tss-react'
import { isEmpty, makeStyles } from 'utils'
import type { AnimationPattern, PixelWorldMapProps } from './PixelWorldMap.d'
// prettier-ignore
const mapArray = [
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0],
@crittelmeyer
crittelmeyer / isEmpty
Created January 21, 2022 23:44 — forked from inPhoenix/isEmpty
Alternative to lodash _.isEmpty
const isEmpty = value => {
return (
value == null || // From standard.js: Always use === - but obj == null is allowed to check null || undefined
(typeof value === 'object' && Object.keys(value).length === 0) ||
(typeof value === 'string' && value.trim().length === 0)
)
}
export default isEmpty
@crittelmeyer
crittelmeyer / machine.js
Last active December 2, 2019 16:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions

Jira shortcuts

As configured in my dotfiles

  • jira new ==> opens a new issue
  • jira dashboard ==> opens your JIRA dashboard
  • jira reported [username] ==> queries for issues reported by a user
  • jira assigned [username] ==> queries for issues assigned to a user
  • jira ABC-123 ==> opens an existing issue
  • jira ABC-123 m ==> opens an existing issue for adding a comment

Rails shortcuts

As configured in my dotfiles

Shortcuts

  • devlog = show development log file

  • prodlog = show production log file

  • testlog = show test log file

  • RED = 'RAILS_ENV=development' => export RED

@crittelmeyer
crittelmeyer / vim_cheatsheet.md
Last active January 25, 2024 20:15
vim cheatsheet
@crittelmeyer
crittelmeyer / git_cheatsheet.md
Last active May 13, 2016 15:59
git cheatsheet

Git Cheatsheet

As configured in my dotfiles

Shortcuts

  • g = git
  • gst = git status
  • ga = git add
  • gb = git branch
  • gcb = git checkout -b
@crittelmeyer
crittelmeyer / rvm_cheatsheet.md
Last active May 13, 2016 16:08
rvm cheatsheet

RVM cheatsheet/shortcuts

As configured in my dotfiles

Shortcuts

  • rubies = list installed ruby versions
  • gemsets = list gemsets

Cheatsheet

  • rvm list known => lists available ruby versions
@crittelmeyer
crittelmeyer / xargs_cheatsheet.md
Created December 31, 2015 01:46
xargs cheatsheet

In general xargs is used like this

$ prog | xargs utility

where prog is expected to output one or more newline/space separated results. The trick is that xargs does not! nessarly call utility once for each result, instead it splits the result list into sublists and calls utility for every sublist. If you want to force xargs to call utility for every single result you will need to invoke it with xargs -L1.

Note that xargs promises you that the sublist sent to utility is shorter than ARG_MAX (this is how it avoids those dreaded Argument list to long errors). You can get the current value of ARG_MAX using getconf ARG_MAX