app state, view state and regional state
separating components and containers
and code-splitting reducers
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
Andy Thomason is a Senior Programmer at Genomics PLC. He has been witing graphics systems, games and compilers since the '70s and specialises in code performance.
# see https://www.topbug.net/blog/2013/04/14/install-and-use-gnu-command-line-tools-in-mac-os-x/ | |
# core | |
brew install coreutils | |
# key commands | |
brew install binutils | |
brew install diffutils | |
brew install ed --default-names | |
brew install findutils --with-default-names |
I hereby claim:
To claim this, I am signing this object:
function saveSelection() { | |
if (window.getSelection) { | |
var sel = window.getSelection(); | |
if (sel.getRangeAt && sel.rangeCount) { | |
return sel.getRangeAt(0); | |
} | |
} else if (document.selection && document.selection.createRange) { | |
return document.selection.createRange(); | |
} | |
return null; |
.comPlainTextContentEditable { | |
-webkit-user-modify: read-write-plaintext-only; | |
} | |
.comPlainTextContentEditable--has-placeholder::before { | |
content: attr(placeholder); | |
opacity: 0.5; | |
color: inherit; | |
cursor: text; | |
} |
// If you have experience with animation in other media, CSS | |
// animation’s percentage-based keyframe syntax can feel pretty | |
// alien, especially if you want to be very precise about timing. | |
// This Sass function lets you forget about percentages and | |
// express keyframes in terms of actual frames: | |
@function f($frame) { | |
@return percentage( $frame / $totalframes ) | |
} |
import React, { Component } from 'react'; | |
import { Field, reduxForm } from 'redux-form'; | |
import moment from 'moment'; | |
import DatePicker from 'react-datepicker'; | |
import ReactQuill from 'react-quill'; | |
import MaskedInput from 'react-maskedinput'; | |
export const renderField = (field) => ( | |
<div> | |
<input {...field.input} type={field.type} placeholder={field.placeholder} className="form-control" /> |
var touchstartX = 0; | |
var touchstartY = 0; | |
var touchendX = 0; | |
var touchendY = 0; | |
var gesuredZone = document.getElementById('gesuredZone'); | |
gesuredZone.addEventListener('touchstart', function(event) { | |
touchstartX = event.screenX; | |
touchstartY = event.screenY; |