Skip to content

Instantly share code, notes, and snippets.

@jonjaques
jonjaques / trippy.js
Created November 13, 2015 22:10
Trippy JS
$(function(){function t(){$("head").append("<style>"+i+"</style>"),$("body").addClass("blobbs"),$("body").append('<div class="trippy"/>')}var e=[38,38,40,40,37,39,37,39,66,65],o=0,i=".blobbs{background-size:66px 66px;background-color:#00a9ff;background-image:repeating-radial-gradient(hsla(200,100%,80%,.8) 0,hsla(200,100%,80%,.5) 4px,hsla(200,100%,80%,0) 50px),repeating-radial-gradient(hsla(260,100%,0%,0) 0,hsla(260,100%,50%,.1) 2px,hsla(260,100%,0%,0) 10px)}.blobbs:hover{animation:blobbs-position 6s cubic-bezier(.4,0,.2,1) infinite,blobbs-size .75s cubic-bezier(.4,0,.2,1) infinite alternate}@keyframes blobbs-position{0%,100%{background-position:left top,left top}25%{background-position:right top,left bottom}50%{background-position:right bottom,right bottom}75%{background-position:left bottom,right top}}@keyframes blobbs-size{from{background-size:200px 200px,200px 200px}to{background-size:66px 66px,66px 66px}}.trippy{position:fixed;z-index:99999;top:0;left:0;right:0;bottom:0;background:rgba(255,0,0,.5);animati
class Coffee {
constructor() {
this.refill()
}
get empty() {
return this.level === 0;
}
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 / 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