This shows an example of a responsive table that utilizes flexbox for it's layout.
Moved from my old account to new: Forked from Ian Svoboda's Pen vIqnD.
A Pen by Ian Svoboda on CodePen.
// See this awesome blog post: http://www.jeffreyharrell.com/blog/2010/11/creating-a-shake-event-in-mobile-safari/ | |
if (typeof window.DeviceMotionEvent != 'undefined') { | |
// Shake sensitivity (a lower number is more) | |
var sensitivity = 20; | |
// Position variables | |
var x1 = 0, y1 = 0, z1 = 0, x2 = 0, y2 = 0, z2 = 0; |
class PubSub { | |
constructor() { | |
this.handlers = []; | |
} | |
subscribe(event, handler, context) { | |
if (typeof context === 'undefined') { | |
context = handler; | |
} | |
var EventSystem = (function() { | |
var self = this; | |
self.queue = {}; | |
return { | |
publish: function (event, data) { | |
var queue = self.queue[event]; | |
if (typeof queue === 'undefined') { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="description" content="check mark success animation"> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<style id="jsbin-css"> | |
/* animations */ | |
@-webkit-keyframes checkmark { |
var Types = new Map(); | |
Types.set(Array, function(v) { | |
var l = v.length; i = 0, a = Array(l); | |
for (i; i<l; i++) { | |
a[i] = v[i]; | |
} | |
return a; | |
}); | |
Types.set(Number, function(v) { | |
return v * 1; |
This shows an example of a responsive table that utilizes flexbox for it's layout.
Moved from my old account to new: Forked from Ian Svoboda's Pen vIqnD.
A Pen by Ian Svoboda on CodePen.
/** | |
* @author alteredq / http://alteredqualia.com/ | |
* @author mr.doob / http://mrdoob.com/ | |
*/ | |
Detector = { | |
canvas : !! window.CanvasRenderingContext2D, | |
webgl : ( function () { try { return !! window.WebGLRenderingContext && !! document.createElement( 'canvas' ).getContext( 'experimental-webgl' ); } catch( e ) { return false; } } )(), | |
workers : !! window.Worker, |
An exploration of the different render methods available in react-enzyme.
/** | |
* 截取指定长度的中英文混合字符串 | |
* @param {String} str 待截取的字符串 | |
* @param {Number} n 截取长度(中文字符为英文的 double) | |
* @return {String} 截取后的字符串 | |
*/ | |
function subString(str, n) { | |
var r = /[^\x00-\xff]/g; | |
var m; |
The Map Remote tool changes the request location, per the configured mappings, so that the response is transparently served from the new location as if that was the original request.
Using this feature for http
resources does't require anything else apart from just configuring your Map Remote entry.
Always make sure you are clearing your cache before you test. Even if Charles is configured properly you might not see the changes unless the browser gets the resource again from the server and not for its local cache.