Skip to content

Instantly share code, notes, and snippets.

Tim Phillips tim-phillips

Block or report user

Report or block tim-phillips

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
@tim-phillips
tim-phillips / remove-empty.js
Created May 1, 2018
removes keys with null values
View remove-empty.js
function removeEmpty (obj) {
Object.keys(obj).forEach(key => {
if (obj[key] && typeof obj[key] === 'object') removeEmpty(obj[key])
else if (obj[key] == null) delete obj[key]
})
}
@tim-phillips
tim-phillips / convert-date.js
Created Apr 17, 2018
Converts ISO 8601 date string to human readable date string
View convert-date.js
function convertDate (date) {
if (!date) return
const d = new Date(date.replace('-', '/'))
return d.toLocaleDateString('en-US', {
year: 'numeric',
month: 'long',
day: 'numeric'
})
}
View yarn-inspect.json
{
"scripts": {
"inspect": "npx -n --inspect <command>"
}
}
View keybase.md

Keybase proof

I hereby claim:

  • I am tim-phillips on github.
  • I am timphillips (https://keybase.io/timphillips) on keybase.
  • I have a public key ASDM2xrS-uzauIms1_pXYIYOYJFi4xWJwfGz8HWxXOMVGgo

To claim this, I am signing this object:

@tim-phillips
tim-phillips / airtable-proxy.js
Created Apr 1, 2018 — forked from benoror/airtable-proxy.js
Node.js Airtable API Proxy
View airtable-proxy.js
var express = require('express');
var proxy = require('http-proxy-middleware');
var options = {
logLevel: 'debug',
target: 'https://api.airtable.com/v0/' + process.env.APP_ID,
changeOrigin: true,
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer ' + process.env.API_KEY
},
@tim-phillips
tim-phillips / slim-redux.js
Created Sep 15, 2017 — forked from gaearon/slim-redux.js
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
View slim-redux.js
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {
You can’t perform that action at this time.