Skip to content

Instantly share code, notes, and snippets.

Jared Palmer jaredpalmer

Block or report user

Report or block jaredpalmer

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
View banned.txt
.htaccess
.htpasswd
.well-known
(null)
+++ATH0
2 girls 1 cup
2g1c
400
401
403
@jaredpalmer
jaredpalmer / useQuery.ts
Created May 14, 2019
Suspense-ready useQuery
View useQuery.ts
import { ApolloError } from 'apollo-boost';
import { print } from 'graphql/language/printer';
import React from 'react';
const queries = new Map();
const getCacheKey = ({ query, ...opts }) =>
`${print(query)}@@${JSON.stringify(opts)}`;
const invalidateCachedQuery = options =>
@jaredpalmer
jaredpalmer / easing.css
Created Apr 20, 2019 — forked from bendc/easing.css
Easing CSS variables
View easing.css
:root {
--ease-in-quad: cubic-bezier(.55, .085, .68, .53);
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19);
--ease-in-quart: cubic-bezier(.895, .03, .685, .22);
--ease-in-quint: cubic-bezier(.755, .05, .855, .06);
--ease-in-expo: cubic-bezier(.95, .05, .795, .035);
--ease-in-circ: cubic-bezier(.6, .04, .98, .335);
--ease-out-quad: cubic-bezier(.25, .46, .45, .94);
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1);
@jaredpalmer
jaredpalmer / codegen.sh
Last active Apr 3, 2019
Swagger Codegen TypeScript Axios
View codegen.sh
#!/bin/bash
# Required: mvn, java, prettier
# Assume you have your API running on port 8080 and swagger is available at http://localhost:8080/swagger.json
# Assume this script file is in a folder called web that is a sibling to swagger codegen
if [[ ! -d ../swagger-codegen/modules/swagger-codegen-cli/target ]]; then
cd ../swagger-codegen # path to codegen
mvn clean package -DskipTests
cd ../web # path to your app
fi
View ErrorMessage.test.tsx
import * as React from 'react';
import * as ReactDOM from 'react-dom';
import { Formik, FormikProps, ErrorMessage } from '../src';
import { noop } from './testHelpers';
import { act } from 'react-dom/test-utils';
interface TestFormValues {
name: string;
email: string;
}
@jaredpalmer
jaredpalmer / build.js
Created Jan 15, 2019
Cross-repo Netlify Webhook Build
View build.js
var shell = require('shelljs');
var fs = require('fs-extra');
var path = require('path');
console.log('WEBHOOK_BODY', process.env.WEBHOOK_BODY);
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
}
@jaredpalmer
jaredpalmer / Postinstall.js
Created Sep 19, 2018
Netlify Webhook Codeload from different website
View Postinstall.js
var shell = require('shelljs');
var fs = require('fs-extra');
var path = require('path');
console.log('WEBHOOK_BODY', process.env.WEBHOOK_BODY);
if (!shell.which('git')) {
shell.echo('Sorry, this script requires git');
shell.exit(1);
}
View all-html-elements.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML5 Test Page</title>
</head>
<body>
<div id="top" class="page" role="document">
<header role="banner">
View Fieldset.tsx
import React from 'react';
import { Field, connect } from 'formik';
import {
FormLabel,
FormGroup,
FormFeedback,
FormHelper,
} from 'common/components/Form';
import { FirstMatchingNodeTarget } from 'common/components/Form/FirstMatchingNodeTarget';
import scrollIntoView from 'smooth-scroll-into-view-if-needed';
@jaredpalmer
jaredpalmer / AuthModel.ts
Last active Aug 15, 2018
Express OAuth2 Provider example
View AuthModel.ts
'use strict';
import * as uuid from 'uuid';
import { Client, ClientDao } from '../dao/ClientDao';
import { Token, TokenDao } from '../dao/TokenDao';
import { User, UserDao } from '../dao/UserDao';
export const getAccessToken = async (bearerToken: string) => {
const token = await TokenDao.loadByToken(bearerToken);
You can’t perform that action at this time.