Skip to content

Instantly share code, notes, and snippets.

View ericclemmons's full-sized avatar
🏠
Working from home

Eric Clemmons ericclemmons

🏠
Working from home
View GitHub Profile
import Alt from 'alt';
import DispatcherRecorder from 'alt/utils/DispatcherRecorder';
let alt = new Alt();
let recorder = new DispatcherRecorder(alt);
// setup actions and store
function Actions() { this.generateActions('a', 'b', 'c'); }
@mattmccray
mattmccray / AnimationMixin.js
Created March 10, 2015 07:22
React AnimationMixin - for Animate.css
// Extracted from a live application. Known to work with latest Chrome/Firefox
// and Animate.css. (IE untested)
export let AnimationMixin= {
playAnimation( animation='pulse', speed=1000) {
if(! this.isMounted()) {
log.warn( "Trying to call .playAnimation() on an unmounted component!")
return
}
@ericclemmons
ericclemmons / FluxContainer.js
Last active August 29, 2015 14:17
Flummox FluxContainer that runs actions, watches stores, and renders a component.
import assign from "object-assign";
import Flux from "flummox";
import React from "react";
export default React.createClass({
displayName: "FluxContainer",
contextTypes: {
flux: React.PropTypes.instanceOf(Flux),
},
@ericclemmons
ericclemmons / .eslintrc
Created March 24, 2015 03:52
My latest .eslintrc
{
"ecmaFeatures": {
"arrowFunctions": true,
"binaryLiterals": false,
"blockBindings": true,
"classes": true,
"defaultParams": true,
"destructuring": true,
"forOf": false,
"generators": true,
@ericclemmons
ericclemmons / default.phtml
Created October 21, 2010 04:45
Jekyll template
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>{{ page.title }} &mdash; CollegeDegrees.com</title>
</head>
<body>
{{ content }}
@ericclemmons
ericclemmons / app.php
Created March 25, 2011 03:49
Zend-friendly app.php using APPLICATION_ENV
<?php
// This is the revised `web/app.php` (click the previous edit of this gist to see the original)
//
// For those of us that deploy along-side Zend Framework apps, whose convention has been to pivot configuration
// around APPLICATION_ENV, `web/app.php` and `web/app_dev.php` is redundant.
require_once __DIR__.'/../app/bootstrap.php.cache';
require_once __DIR__.'/../app/AppKernel.php';
//require_once __DIR__.'/../app/bootstrap_cache.php.cache';
@ericclemmons
ericclemmons / copy_file.sh
Created February 29, 2012 19:22
Rackspace Cloudfiles API - Copy File with Curl
# We need to get an AUTH TOKEN first
curl -X GET -D - \
-H "X-Auth-User: $USER" \
-H "X-Auth-Key: $API_KEY" \
https://auth.api.rackspacecloud.com/v1.0 \
# HTTP/1.1 204 No Content
# Server: Apache/2.2.3 (Red Hat)
# vary: X-Auth-Token,X-Auth-Key,X-Storage-User,X-Storage-Pass
# X-Storage-Url: https://storage101.ord1.clouddrive.com/v1/MossoCloud-something-something
@srph
srph / resolve.js
Created October 20, 2015 16:20
resolve wrapper for redux + react resolver
import { resolve } from 'react-resolver';
import store from 'app-store';
/**
* A wrapper to fill in the first argument with a dummy string.
* This helps because we usually don't set it to a prop, but
* to a Reducer.
*
* Also gives us the `dispatch` of the Store (yepee)
*
@ericrasch
ericrasch / restore osx.md
Last active April 13, 2016 18:29
How to reset a Mac: restore your Mac to the original factory settings

Restore your Mac to the original factory settings

  1. Deauthorize your iTunes store account. (You should also deauthorize any third-party apps, such as Photoshop, that are locked to your Mac).
  2. Turn off FileVault (if you are using it).
  3. Sign out of iCloud.
  4. Restart the Mac in Recovery Mode (hold down Command + R key during restart).
  5. Use Disk Utility to erase the hard drive. Click on Disk Utility > Continue. Select the Main volume and click Unmount then Erase). Quit Disk Utility (Disk Utility > Quit Disk Utility).
  6. Click Reinstall OS X and Continue. Follow the instructions to reinstall Mac OS X.

Source: http://www.macworld.co.uk/how-to/mac/how-reset-macbook-restore-your-mac-original-factory-settings-3494564/

@puppybits
puppybits / Dockerfile
Last active June 12, 2017 17:37
<10s Docker/NPM build & develop from a docker container
FROM node
RUN mkdir -p /app
WORKDIR /app
# .deps.json will only bust the cache when the package.json dependencies change
COPY .deps.json /app/package.json
RUN npm install
# cache will almost always bust here, but it's only copying files