Skip to content

Instantly share code, notes, and snippets.

@matthieuprat
matthieuprat / README.md
Last active September 23, 2021 16:29
Until operator for Enzyme's shallow wrapper

Usage

import until from 'path/to/until'
import { shallow } from 'enzyme'

const EnhancedFoo = compose(
  connect(...),
  withHandlers(...),
 withContext(...)
@ysugimoto
ysugimoto / setup.sh
Last active March 6, 2020 07:49
set up docker-compose.yml
#!/bin/bash
YOU=`whoami`
CWD=$(cd $(dirname $0);pwd)
# Create mout storage directory if not exists
if [ ! -d "$HOME/perfstore/graphite" ]; then
echo "creating directory: $HOME/perfstore/graphite..."
mkdir -p $HOME/perfstore/graphite
fi
@starstuck
starstuck / wheel-event-polyfill.js
Last active March 11, 2018 14:23
Mouse 'wheel' event polyfill for webkit browsers
/**
* Mouse wheel polyfill inspired by cross-browser example on mdn wiki.
*
* It supports relatively modern browsers, which already support addEventListener and Array forEach methods.
* Effectively it is targeting webkit based browsers. I didn't have opportunity to test it on old Firefox.
* Method addEventListener is supported in IE9, which already supports wheel event. I guess one could combine
* it with polyfill for addEventListener to have support in IE 6-8. In that case one would have to also wrap
* all addEventListener methods provided by the polyfill (last block below).
*
* @see https://developer.mozilla.org/en-US/docs/Web/Reference/Events/wheel?redirectlocale=en-US&redirectslug=DOM%2FMozilla_event_reference%2Fwheel#Listening_to_this_event_across_browser
/**
* @constructor
* @param {Object} config A valid configuration.
*/
var Photos = function(config) {
var core = require("./core")(config),
logger = require('log4js')(config.log4js).getLogger("node-foursquare.Photos");
/**
* Retrieve a photo from Foursquare.