Skip to content

Instantly share code, notes, and snippets.

View randallagordon's full-sized avatar

Randall A. Gordon randallagordon

View GitHub Profile
Draziw.Button.Mines
ag.video_solutions.wedotv
ahf.dummynation
ai.socialapps.speakmaster
air.com.beachbumgammon
air.com.freshplanet.games.SongPop2
air.com.gamesys.mobile.slots.jpj
air.com.goodgamestudios.empirefourkingdoms
air.com.kitchenscramble.goo
air.com.lalaplay.rummy45
@bvaughn
bvaughn / eager-prefetching-async-data-example.js
Last active November 28, 2024 00:44
Advanced example for eagerly prefetching async data in a React component.
// This is an advanced example! It is not intended for use in application code.
// Libraries like Relay may make use of this technique to save some time on low-end mobile devices.
// Most components should just initiate async requests in componentDidMount.
class ExampleComponent extends React.Component {
_hasUnmounted = false;
state = {
externalData: null,
};
@manifestinteractive
manifestinteractive / long-term-prep.md
Last active September 7, 2017 07:19
Long Term Prep

Long Term Prep

By no means am I an expert on this stuff, but I have been doing basic research on this from year to year and have been trying to keep up with "best practices". I started this "prepper" stuff back in St. Louis, MO as we lived on a fault line and we were well past due for a major earthquake ( by 100+ years actually ). So I felt kind of stupid not being ready if it was a pretty good bet that at some point in my life, I was going to meet a natural disaster.

Something important to note, is that I did not just drop a bunch of money on this all at once. I just slowly accumulated things over the past 6-8 years. I figured if I budgeted about max of $250 a year on preparation stuff, I would only need to do that for a few years before I could have a pretty decent nest egg.

My primary focus was based purely on how I live my life, which is that I mainly work from home with my wife, and when I am traveling, it's usually by car, and I'm usually within 30 miles from home.

Get Home Bag (GHB)

@developit
developit / *state-machine-component.md
Last active February 6, 2021 00:44
265b lib for building pure functional state machine components. https://github.com/developit/state-machine-component

state-machine-component

A tiny (265 byte) utility to create state machine components using two pure functions.

🔥 JSFiddle Demo

Usage

The API is a single function that accepts 2 pure functions as arguments:

@ryanflorence
ryanflorence / rails-ey.jsx
Last active February 2, 2018 22:01
Rail-ey style routes
const lookup = (namespace) => {
// if you really want rails-style indirection, you'd
// need an app container that could look up modules
// by strings.
}
const Resources = ({ namespace }) => {
const Layout = lookup(namespace, 'layout')
return (
<Route path={`/${namespace}`} render={() => (
@maddie927
maddie927 / scroll-manager.js
Last active May 9, 2021 14:17
Scroll Manager for React Router v4
import React from 'react'
import { func, node, number, object, shape, string } from 'prop-types'
import { withRouter } from 'react-router'
import debounceFn from 'lodash/debounce'
class ScrollManager extends React.Component {
static propTypes = {
children: node.isRequired,
history: shape({
action: string.isRequired,
// routes.js
const routes = [
{
path: '/',
component: Home,
exact: true
},
{
path: '/gists',
component: Gists
@bisubus
bisubus / ES5-ES6-ES2017-ES2019 omit & pick
Last active April 13, 2024 21:03
ES5/ES6/ES2017/ES2019 omit & pick

This document has moved!

It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.