Skip to content

Instantly share code, notes, and snippets.

const Jon = new Person('Jon')
const mug = new Mug()
const pot = new Pot()
// It never ends...
(async function typicalDay() {
while (Jon.isAwake) {
if (Jon.energy < 110) {
if (mug.empty) {
if (pot.fresh) {
@jonjaques
jonjaques / index.html
Created May 9, 2016 21:58
Micro jQuery plugin to automatically link emails and telephone numbers.
<!DOCTYPE html>
<html>
<head>
<title>Test</title>
</head>
<body>
<div id="container">
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec rhoncus magna a dapibus consequat. Nullam vestibulum scelerisque ipsum sit amet placerat. Nam nec diam sollicitudin, dictum velit sed, elementum libero. Cras ut interdum leo, in commodo odio. Ut sed metus ut lacus semper scelerisque non tincidunt lectus. Phasellus eu diam hendrerit, maximus ipsum pulvinar, +2(202)-302-2300 dignissim nulla. Phasellus aliquam, mauris eu bibendum blandit, eros augue varius nibh, auctor pellentesque metus purus vitae arcu. Donec velit tellus, jon@3five.com iaculis ut fringilla at, vestibulum nec libero. Proin convallis, lectus sit amet hendrerit maximus, neque est hendrerit ipsum, ut viverra diam velit id nisi. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque placerat ex in lobortis molestie. Ut elementum volutpat mollis. Quisque porta, arcu a fermentum aliquam, sa
@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
@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 / 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
const webpack = require('webpack')
const path = require('path')
module.exports = [
build('browser'),
build('server')
]
function build(env = 'browser') {
let config = {}
@jonjaques
jonjaques / example.js
Last active October 25, 2017 06:04
Library agnostic version of jQuery's Extend
function myFunction(opts) {
var defaults = {
param1: 'foo',
param2: 'bar'
};
var options = __extend(defaults, opts);
return options;
}
myFunction({param2: 'baz'}); // { param1: 'foo', param2: 'baz' }
@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} />
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 / 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