Skip to content

Instantly share code, notes, and snippets.

// useful at script.google.com
// set these to discord webhooks.
const WEBHOOKS = {
SLAB: '',
ASANA: '',
FIGMA: '',
GREENHOUSE: ''
}
// these searches work great for me. The first does the search logic in
@joeybaker
joeybaker / open-in-vi.scrpt
Created June 14, 2018 18:32
Applescript to use in automator to open a file in Terminal in neovim
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"
activate
if terminalIsRunning is true then
set newWnd to do script with command cmd
else
do script with command cmd in window 1
@joeybaker
joeybaker / react-redux-links.md
Last active March 21, 2018 00:21
React/redux links
// @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
joeybaker / redux-bugsnag.js
Created November 11, 2016 20:30
Redux middleware for bugsnag
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 (https://keybase.io/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:

From c39e95ae6d41939e73568bea5782228d8590b953 Mon Sep 17 00:00:00 2001
From: Joey Baker <[email protected]>
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 +++++++++++++++++
#!/bin/bash
# strict mode http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'
function f () {
# set these to your server crt and key files
local crt=server.crt
local key=server.key
"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 \"//registry.npmjs.org/:_authToken=$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"
@joeybaker
joeybaker / index.js
Last active November 17, 2016 02:59
css-modules require hook for node. via https://github.com/css-modules/css-modules/issues/13
import setupCSS from './load-css-require.js'
setupCSS(__dirname, (err) => {
if (err) throw err
require('my-front-end-components-that-require-css-files.js')
})