Skip to content

Instantly share code, notes, and snippets.

View jimjeffers's full-sized avatar

Jim Jeffers jimjeffers

View GitHub Profile
@benpickles
benpickles / action.js
Created March 18, 2016 16:19
Inject an Authorization header into a redux-api-middleware request with a Redux middleware.
import { CALL_API } from 'redux-api-middleware'
export function fetchLocations() {
return {
[CALL_API]: {
endpoint: 'http://api.somesite.com/api/locations',
method: 'GET',
// Don't have to manually add the Authorization header to every request.
headers: { 'Content-Type': 'application/json' },
types: ['REQUEST', 'SUCCESS', 'FAILURE']
@mchung
mchung / sourcing.io.html
Created February 5, 2014 19:35
Preloading video trick
<div class="preview">
<div class="inner">
<img src="/assets/site/placeholder-4abfbbec6d239b5708837804f8149b32.png">
<video preload="auto">
<source src="https://di3zio5pem6rb.cloudfront.net/site/preview.mp4" type="video/mp4">
<source src="https://di3zio5pem6rb.cloudfront.net/site/preview.ogv" type="video/ogv">
<source src="https://di3zio5pem6rb.cloudfront.net/site/preview.webm" type="video/webm">
</video>
</div>
@mchung
mchung / Gemfile-rails-2.3.8.rb
Created May 27, 2010 21:20
Rails! Featuring Bundler, Cucumber, RVM, Postgres, on Ruby-1.8.7
# Everything you need to do to get started with Rails 2.3.8
#
# As of June 14th, 2010 @ 2:30 p.m. MST
#
# This gist now features instructions to get Rails 3 up and running with:
# - Ruby 1.8.7-p174
# - Bundler 0.9.26
# - Cucumber 0.8.0
# - Rspec 1.3.0 + Rspec-Rails 1.3.2
# - RVM