Skip to content

Instantly share code, notes, and snippets.

View nathanforce's full-sized avatar

Nathan Force nathanforce

  • Headway
  • New York, New York
View GitHub Profile
@nathanforce
nathanforce / action.ts
Created September 30, 2021 14:55
Sendgrid Github Action
import * as core from '@actions/core';
import * as github from '@actions/github';
import client from '@sendgrid/client';
import path from 'path';
import fs from 'fs';
import colors from 'ansi-styles';
// @ts-ignore
import HumanHash from 'humanhash';
async function upload(files: string[]) {
@nathanforce
nathanforce / repeat.ics
Created September 3, 2021 20:59
ICS with COUNT rrule
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ical.marudot.com//iCal Event Maker
CALSCALE:GREGORIAN
X-WR-CALNAME:Therapy Notes Calendar
BEGIN:VTIMEZONE
TZID:America/Havana
LAST-MODIFIED:20201011T015911Z
TZURL:http://tzurl.org/zoneinfo-outlook/America/Havana
X-LIC-LOCATION:America/Havana
@nathanforce
nathanforce / repeat.ics
Last active October 18, 2021 19:19
Demo ics
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//ical.marudot.com//iCal Event Maker
CALSCALE:GREGORIAN
BEGIN:VTIMEZONE
TZID:America/Havana
LAST-MODIFIED:20201011T015911Z
TZURL:http://tzurl.org/zoneinfo-outlook/America/Havana
X-LIC-LOCATION:America/Havana
BEGIN:STANDARD
@nathanforce
nathanforce / .gitconfig
Last active December 27, 2019 15:29
vscode
[alias]
co = checkout
br = branch
brl = branch --sort=-committerdate --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:green)%(committerdate:relative)%(color:reset) - %(authorname)'
st = status
cm = commit
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
[core]
pager = diff-so-fancy | less --tabs=4 -RFX
@nathanforce
nathanforce / MyForm.jsx
Created May 2, 2018 18:32
Formik Config Based Fields
const fieldsConfig = {
title: {
label: 'Title',
},
postal: { label: 'Postal Code' },
type: { label: 'Job Type' },
experience: { label: 'Experience Level' },
description: { label: 'Description', component: 'textarea' },
url: { label: 'URL', helper: `You don't need to include http://` },
};
@nathanforce
nathanforce / Example.jsx
Created February 9, 2017 20:07
Get ref of child
class Input extends Component {
// other stuff
render() {
return <input value={this.props.value} onChange={this.props.onChange} />
}
};
class CoolComponent extends Component {
// other stuff
doSomethingWithRealInput() {
@nathanforce
nathanforce / generator.jsx
Created September 8, 2016 04:30
React JSX Generator Pattern
import Spinner from './components/Spinner';
import Error from './components/Error';
import SomeCoolComponent from './components/SomeCoolComponent';
const SomeContainerComponent = props => {
function *generateContent() {
if (props.isLoading) {
yield <Spinner />;
} else if (props.isError) {
yield <Error />;