Skip to content

Instantly share code, notes, and snippets.

View timbuckley's full-sized avatar

Tim Buckley timbuckley

  • Aline
  • NYC
View GitHub Profile
@timbuckley
timbuckley / logger.js
Created March 24, 2016 17:02
Super simple logging middleware for Redux
import Conf from '../conf' // Various app-level options, including a logging flag.
const logger = store => next => action => {
// Middleware format.
// - Logs each action as they come in,
// - Dispatches the action, and
// - Logs the new state.
if (Conf.logging && typeof console.group === 'function') {
console.group(action.type)
console.info('📲 dispatching', action)
var menuInput = "Lunch Box,Roast Beef\nTotto Ramen,Miso Noodles\nLunch Box,Turkey\nTotto Ramen,Kimchee\nEl Centro,Enchiladas\nBengal Tiger,Garlic Naan\nLunch Box,Tomato Avocado\nTotto Ramen,Spicy Noodles\nLunch Box,Soup of the Day\nBengal Tiger,Saag Paneer\nTotto Ramen,Pork Bun\nIsland Burgers and Shakes,Fries\nBengal Tiger,Chicken Tikka Masala\nEl Centro,Chips and Guacamole\nIsland Burgers and Shakes,Chocolate Milkshake\nTotto Ramen,Hot Tea\nIsland Burgers and Shakes,Cheddar Burger\nBengal Tiger,Chicken Vindaloo\nIsland Burgers and Shakes,Garden Burger\nEl Centro,Fajitas";
// Nested list of restaurant-item pairs.
var menuObj = {},
pairs = menuInput
.split("\n")
.map(function(pair) {return pair.split(',')}); //in ES6: pair => pair.split(',')
// Build into menuObj.
@timbuckley
timbuckley / SassMeister-input-HTML.html
Created February 27, 2015 18:14
Generated by SassMeister.com.
<h1>animate a circle to a line in CSS</h1>
<h2>requires box-reflect (-webkit-)</h2>
<div class="shape">hover me
<div class="quarter-circle"></div>
<div class="quarter-circle"></div>
<div class="quarter-circle"></div>
</div>