Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jonjaques on github.
  • I am jonjaques (https://keybase.io/jonjaques) on keybase.
  • I have a public key ASBhc0Pd34Du7yeU3-fjduwLSoM1cldg60BUVE1K14XWawo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@jonjaques
jonjaques / an-example.ts
Last active September 10, 2020 03:20
Create Async Actions w/ Redux-Toolkit
export const fetchStuff = createAsyncAction('fetchStuff', (id) => api.fetch(id))
export interface IState {
loading: boolean
stuff?: IStuff
error?: Error
}
export default createReducer<IState>({loading: false}, builder => builder
.addCase(fetchStuff.pending, (state, action) => {
@jonjaques
jonjaques / TrumpTextRNN.txt
Created June 15, 2018 18:09
Some sample output...
Congrats to @BarackObama is the president of the people will be a great statement and the terrible has a great guy on the people of the election and sold that I am not a great company is a political security and protection and show for the restaurants of my first things and his problem.
The U.S. Clinton because he is a total statement of the president in the U.S. and a great speech with the primary and a show in the U.S. and the Election and Fortunate and it is a presidential players of the country to make a great people at the Apprentice will be a great show in the world and pro
I will be interviewed on @FoxNews is a great guy. I should have a total safety of the great people and says a country and desperate to stay the great restaurant of the U.S. See you think the most and failed in the great political candidate and a speech of the players for the Republican Party Confe
@TrumpNewYork @CNN Thanks Marco Rubio and a great states and good luck in the great people of the Trump Senate and Congress are a great
The Democrats to experience is a stupid with representations of the mean Americans sayed Trump National Doran and the economy and the United States should be an it is working at the Apprentice and WI Congress many thought and have high and being in Air!
Can't be clear job will be at a great open of the open and trade worse with now that he should have all the great honor to have people have done and do not things are not great people of you destroyed to the enemblement everyone guns that I love problems. Major ever. @BarackObama is a big place wi
.....................
The people & the failing @nytimes. They doctor than the country for Trump Tower National Pinsond Marines and Federal Collection will see you really big rather of the many downow at 7:00 P.M. Enjoy!
@twiteson is working to the personal Imminenial & Trump wonderful people should have long and discuss new place with Carthy and WASTE HAVE ---- I love it will be failed to never favority has ruck to the United States of the House Hannity is not th
@jonjaques
jonjaques / app.js
Last active February 26, 2018 05:28
Reload your app on the server too; `web.js` is the entrypoint on the browser, `renderer.js` is a verrry simple middleware for server rendering. Ideally you wouldn't be passing content in the entry points, only config.
import React from 'react'
import Foo from './foo'
import {hot} from 'react-hot-loader'
export default hot(module)(App)
function App(props) {
return <h1>
{props.message}
<Foo foo={100} />
const webpack = require('webpack')
const path = require('path')
module.exports = [
build('browser'),
build('server')
]
function build(env = 'browser') {
let config = {}
@jonjaques
jonjaques / gist:61a4a91e8fd5e67cf0f8030ef6b8de6e
Created March 31, 2017 17:24
Create .ICO / Favicon with multiple resolutions
> brew install imagemagick
> convert icon-16px.png icon-32px.png icon-64px.png icon-128px.png favicon.ico
@jonjaques
jonjaques / presentation.js
Last active February 22, 2017 17:51
A declarative state connector for React-Redux
import React from 'react'
import * as someActionCreators from './actions-creators'
import StateConnector from './state-connector'
export default function Usage(props) {
return <StateConnector selector="some.state[0].slice" as="things" actions={someActionCreators}>
<PresentationComponent />
</StateConnector>
}
@jonjaques
jonjaques / render-helpers.js
Created August 26, 2016 21:06
Render helpers for redux-form@6.0.0-rc4
import React from 'react'
import {
FormGroup,
InputGroup,
FormControl,
Col,
ControlLabel,
Checkbox,
Radio,
HelpBlock