Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
import React from 'react'; | |
import {green500} from 'material-ui/styles/colors'; | |
import FlatButton from 'material-ui/FlatButton'; | |
import ContentSave from 'material-ui/svg-icons/content/save'; | |
import TextField from 'material-ui/TextField'; | |
class TextEditOnClick extends React.Component { | |
constructor() { | |
super(); | |
this.state = {show_input: false, valid: true}; |
let database = window.firebase.database(); | |
// go offline if incomes more events per second from firebase | |
let events_buffer = 0; | |
let online = true; | |
const go_online = () => { | |
if (events_buffer > 6) { |
/* | |
- Get SVG from https://design.google.com/icons/ | |
- Change lines 31-32 with icon's path | |
*/ | |
import React from 'react'; | |
class IconDone extends React.Component { | |
shouldComponentUpdate(nextProps, nextState) { |
{ | |
"env": { | |
"browser": true, | |
"node": true, | |
"es6": true | |
}, | |
"globals": { | |
"console": true, | |
"db": true | |
}, |
import {config} from './../config/config'; | |
const firebase = require('firebase'); | |
const moment = require('moment'); | |
const recursive = require('recursive-readdir'); | |
const fs = require('fs'); | |
const numeral = require('numeral'); | |
firebase.initializeApp({ | |
databaseURL: config.firebase.db_name, | |
serviceAccount: './config/firebase.json' |
const ReactGA = require('react-ga'); | |
ReactGA.initialize('UA-00000000000-1'); | |
const _route_change_handler = (location) => { | |
ReactGA.set({page: location.pathname}); | |
ReactGA.pageview(location.pathname); | |
}; | |
export default ( | |
<Route |
/* | |
To enable google analytics with autotracker do these steps: | |
1. Add analytics script to head, i used <Helmet /> so one more entry to scripts array: | |
{async: true, src: 'https://www.google-analytics.com/analytics.js'}, | |
2. add code below to routes.js | |
P.s. to generate static files this line is added, because document obj. is missing at that moment. |
#! /bin/bash | |
sudo apt-get update | |
sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev -y | |
git clone https://github.com/nghttp2/nghttp2.git && cd nghttp2 | |
autoreconf -i | |
automake | |
autoconf | |
./configure --enable-apps | |
make |
let levenshtein = function (str1, str2) { | |
let current = [], prev, value; | |
for (let i = 0; i <= str2.length; i++) | |
for (let j = 0; j <= str1.length; j++) { | |
if (i && j) | |
if (str1.charAt(j - 1) === str2.charAt(i - 1)) | |
value = prev; | |
else | |
value = Math.min(current[j], current[j - 1], prev) + 1; |