Skip to content

Instantly share code, notes, and snippets.

Joey Baker joeybaker

Block or report user

Report or block joeybaker

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
joeybaker / open-in-vi.scrpt
Created Jun 14, 2018
Applescript to use in automator to open a file in Terminal in neovim
View open-in-vi.scrpt
on run {input}
set filename to POSIX path of input
set cmd to "clear;cd $(dirname " & filename & ");nvim " & quoted form of filename & "; exit"
tell application "System Events" to set terminalIsRunning to exists application process "Terminal"
tell application "Terminal"
if terminalIsRunning is true then
set newWnd to do script with command cmd
do script with command cmd in window 1
View vim-styled-components-syntax-weirdness
// @flow
// This is a mininmal example, much of the real component is stripped out.
import React, { PureComponent } from 'react'
import { Image, Alert } from 'react-native'
import autobind from 'autobind-decorator'
import styled from 'styled-components/native'
import Form from '../../components/Form/Form.component'
joeybaker / redux-bugsnag.js
Created Nov 11, 2016
Redux middleware for bugsnag
View redux-bugsnag.js
import requestAnimationFrame from 'fbjs/lib/requestAnimationFrame'
import {get, omit} from 'lodash'
// this is okay b/c we tell webpack to ignore the node version of bugsnag in
// package.json
// "browser": {"bugsnag": false}
import bugsnag from 'bugsnag'
const SEVERITIES = {ERROR: 'error', WARN: 'warning', INFO: 'info'}
const NODE_ENV = process.env.NODE_ENV
const IS_BROWSER = process.browser

Keybase proof

I hereby claim:

  • I am joeybaker on github.
  • I am joeybaker ( on keybase.
  • I have a public key whose fingerprint is E79A 8CB3 BD26 FAF2 DE85 050C D111 C7BF 1E35 AF45

To claim this, I am signing this object:

View npm-should-install.patch
From c39e95ae6d41939e73568bea5782228d8590b953 Mon Sep 17 00:00:00 2001
From: Joey Baker <>
Date: Thu, 31 Mar 2016 11:17:44 -0700
Subject: [PATCH] Add: bin/should-install
Small script that warns if the dependencies are different from the last
time the script was run.
bin/lib/should-install.js | 61 +++++++++++++++++++++++++++++++++++++++++++++++
bin/should-install | 22 +++++++++++++++++
# strict mode
set -euo pipefail
function f () {
# set these to your server crt and key files
local crt=server.crt
local key=server.key
View gist:4d20303d56d8cb8a82af
"note6": "cirlce ci gives us the ability to run set-npm-token before npm i, heroku does not, so we have to detect the heroku env and manually run npm install because changing .npmrc from an npm hook isn't pick up until the next run of npm",
"set-npm-token": "if [ -n \"${NPM_TOKEN-}\" ]; then echo \"//$NPM_TOKEN\" >> .npmrc; fi",
"preinstall": "npm run set-npm-token && if [ -n \"${DEPLOY_ENV-}\" ]; then echo installing; npm install --unsafe-perm --userconfig .npmrc --ignore-scripts; fi",
"postinstall": "if [ -n \"${DEPLOY_ENV-}\" ]; then npm run build; fi"
View index.js
import setupCSS from './load-css-require.js'
setupCSS(__dirname, (err) => {
if (err) throw err
joeybaker / On
Created May 22, 2015
Notes on an intro to using npm
View On

On npm

Three "types" of modules

cli modules

  • "bin" in package.json
  • keeping index.js and bin/module separate. You want both programmatic and cli access
  • use yargs to parse options from the CLI. You can do this manually, but it's painful and error prone. yargs also helps you build a good UI.
  • make sure to set the "main" field

browser modules

You can’t perform that action at this time.