Skip to content

Instantly share code, notes, and snippets.

View chranderson's full-sized avatar
👋

Chris Anderson chranderson

👋
  • Denver, Colorado
View GitHub Profile
@chranderson
chranderson / .ts
Last active March 17, 2024 23:00
Typescript Patterns
/** String literal union from Enum */
enum Status {
FAILED: 'fail',
PENDING: 'pending,
SUCCESS: 'success',
}
type StatusType = `${AccessPassVariant}`
// StatusType = 'fail' | 'pending' | 'success'
@chranderson
chranderson / createFavicon.txt
Created September 5, 2018 19:46
multi-size favicon generator
install imagemagick (node)
https://www.npmjs.com/package/imagemagick
- npm -g install imagemagick
- brew install imagemagick
// in directory that contains favicon.png, run bash command:
convert favicon.png -alpha on -resize 256x256 \
-define icon:auto-resize="256,128,96,64,48,32,16" \
favicon.ico
@chranderson
chranderson / .gitconfig
Created August 22, 2018 20:34
Fix git error: Could not read Username for gitlab
// cat ~/.gitconfig # Note, this might be ~/.git/config for you
[user]
email = user@example.com
name = Example user
[url "git@gitlab.com:"]
insteadOf = https://gitlab.com/
@chranderson
chranderson / indexArray.js
Created August 8, 2018 15:47
create indexed array by count
const createArray = count => Array(count).fill().map((x, i) => i)
const tenItemArray = createArray(10)
console.log(tenItemArray)
// [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
@chranderson
chranderson / asyncDelay.js
Created August 8, 2018 15:39
async delay function
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
@chranderson
chranderson / installation.md
Created April 27, 2018 02:32
Hyper 2.0 Setup
@chranderson
chranderson / remove-git-tag.sh
Created November 7, 2017 20:06
Remove git tag
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@chranderson
chranderson / nvmCommands.js
Last active April 25, 2024 07:16
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node
'.source.js':
'component':
'prefix': 'comp'
'body': """
import React, { Component, PropTypes } from 'react';
import {
${1:Name}style
} from '${1:Name}Styles.js';
@chranderson
chranderson / activator-setup.txt
Last active November 17, 2015 16:59
installing java / activator
install homebrew
> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
install Java w/ homebrew **Dont install java with oracle**
> brew tap caskroom/cask
> brew install brew-cask
If you get the error "already installed", follow the instructions to unlink it, then install again:
> brew unlink brew-cask
> brew install brew-cask