If you currently not using a service worker resulting in old production caches being used and users not getting new versions of the app.
src/index.js
Use:
import { unregister as unregisterServiceWorker } from './registerServiceWorker'
package com.sample.reactapp; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.net.Uri; | |
import android.os.Build; | |
import android.os.Bundle; | |
import android.provider.Settings; | |
import android.view.KeyEvent; | |
import android.widget.Toast; |
require('isomorphic-fetch'); | |
fetch('https://1jzxrj179.lp.gql.zone/graphql', { | |
method: 'POST', | |
headers: { 'Content-Type': 'application/json' }, | |
body: JSON.stringify({ query: '{ posts { title } }' }), | |
}) | |
.then(res => res.json()) | |
.then(res => console.log(res.data)); |
Direct copy of pre-encoded file:
$ ffmpeg -i filename.mp4 -codec: copy -start_number 0 -hls_time 10 -hls_list_size 0 -f hls filename.m3u8
import firebase from 'firebase' | |
import { filter, map } from 'lodash' | |
import { makeExecutableSchema } from 'graphql-tools' | |
firebase.initializeApp({ | |
databaseURL: 'https://grafire-b1b6e.firebaseio.com', | |
}) | |
const mapSnapshotToEntity = snapshot => ({ id: snapshot.key, ...snapshot.val() }) | |
const mapSnapshotToEntities = snapshot => map(snapshot.val(), (value, id) => ({ id, ...value })) |
import sinonStubPromise from 'sinon-stub-promise'; | |
import sinon from 'sinon' | |
sinonStubPromise(sinon) | |
let stubedFetch = sinon.stub(window, 'fetch') ) | |
window.fetch.returns(Promise.resolve(mockApiResponse())); | |
function mockApiResponse(body = {}) { |
This guide assumes you have the emmet
and language-babel
packages already installed in Atom
keymap.cson
file by clicking on Atom -> Keymap…
in the menu bar'atom-text-editor[data-grammar~="jsx"]:not([mini])':
var fs = require('fs'); | |
// | |
// reference for accessing file system using node.js | |
// http://www.sitepoint.com/accessing-the-file-system-in-node-js/ | |
fs.readFile('image.png', 'binary', function(error, data) { | |
var buf = new Buffer(data, 'binary'); | |
var string = buf.toString('base64'); | |
var limit = parseInt(string.length/50); | |
console.log('Data url of the image.png in not more than 50 characters per line:'); | |
console.log(''); |