If you're using a high-end bluetooth headset on your Macbook Pro it's likely your mac is using an audio codec which favors battery efficiency over high quality. This results in a drastic degradation of sound, the SBC codec is the likely culprit, read more about it here.
React recently introduced an experimental profiler API. This page gives instructions on how to use this API in a production release of your app.
Table of Contents
React DOM automatically supports profiling in development mode for v16.5+, but since profiling adds some small additional overhead it is opt-in for production mode. This gist explains how to opt-in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { combineReducers } from 'redux'; | |
| import users from './reducers/users'; | |
| import posts from './reducers/posts'; | |
| export default function createReducer(asyncReducers) { | |
| return combineReducers({ | |
| users, | |
| posts, | |
| ...asyncReducers | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import React from 'react'; | |
| import $script from 'scriptjs'; | |
| require('postscribe/htmlParser/htmlParser.js'); // This is required for postScribe, postScribe is a bit annoying. | |
| const postscribe = require('exports?postscribe!postscribe'); // Needs webpack exports-loader! Otherwise, just require it and use window.postscribe. | |
| // This GlobalAdCodePromise is a simple promise that uses script.js to load a javascript file and then resolve. | |
| const GlobalAdCodePromise = new Promise((resolve) => { | |
| setTimeout(() => { | |
| $script('http://annoying.adprovider.com/ad.js', () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * On server, just register all of the resources directly to the plugin. On the client, pass in a loader file that maps bundle | |
| * name to webpack bundle require (a separate entry point). Then from your action, you can call `context.loadBundle` to load | |
| * the bundle resources. On the server, the resources are already available but on the client they will be lazy loaded by | |
| * webpack. | |
| */ | |
| 'use strict'; | |
| var debug = require('debug')('BundlePlugin'); | |
| var PromiseLib = global.Promise || require('es6-promise').Promise; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (window.navigator.geolocation) { | |
| navigator.geolocation.getCurrentPosition(function (position) { | |
| var lat = position.coords.latitude, | |
| lng = position.coords.longitude, | |
| latlng = new google.maps.LatLng(lat, lng), | |
| geocoder = new google.maps.Geocoder(); | |
| geocoder.geocode({'latLng': latlng}, function(results, status) { | |
| if (status == google.maps.GeocoderStatus.OK) { | |
| if (results[1]) { | |
| for (var i = 0; i < results.length; i++) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function extractByClass($class,$context){ | |
| preg_match_all('#<\s*(\w+)\s*class="\s*'.$class.'\s*"[^>]*>(.*?)</\s*\g1\s*>#sm',$context,$matches); | |
| return $matches[2]; | |
| } | |
| function extractByID($class,$context){ | |
| preg_match_all('#<\s*(\w+)\s*id="\s*'.$class.'\s*"[^>]*>(.*?)</\s*\g1\s*>#sm',$context,$matches); | |
| return $matches[2]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Class Chainable | |
| * Wrapper for convenient chaining methods | |
| * | |
| * @author Stefano Azzolini <lastguest@gmail.com> | |
| */ | |
| class Chainable { | |
| private $instance = null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (/[A-z\u00C0-\u00ff]+/g) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * L.TileLayer is used for standard xyz-numbered tile layers. | |
| */ | |
| L.Google = L.Class.extend({ | |
| includes: L.Mixin.Events, | |
| options: { | |
| minZoom: 0, | |
| maxZoom: 18, | |
| tileSize: 256, |
NewerOlder
