Posts

fix up chromium m47 build error: unsupported reloc 42 against global symbol gmon_start

Error: ld.gold: error: /usr/lib/gcc/x86_64-linux-gnu/5.3.1/../../../x86_64-linux-gnu/crti.o: unsupported reloc 42 against global symbol gmon_start Solution: export GYP_DEFINES="linux_use_bundled_gold=0"

bizcharts example: Line Chart

Image
Chart UI Codes ChartComponent.js import React, { Component } from 'react'; import {Chart, Axis, Tooltip, Geom, Coord, Label} from 'bizcharts'; import DataSet from '@antv/data-set'; const { DataView } = DataSet; export class LineChart extends Component { render() { const { data, width, height } = this.props; if (!data || data.length <= 0) return null; const ytitle = { autoRotate: true, offset: -10, textStyle: { fontSize: '22', textAlign: 'left', fill: 'rgb(75,83,87)', rotate: 0 }, position: 'end', }; const xtitle = { autoRotate: true, offset: -20, textStyle: { fontSize: '22', textAlign: 'center', fill: 'rgb(75,83,87)', rotate: 0 }, position: 'end', }; const line = { stroke: 'rgb(197,197,200)', lineWidth: 2

bizcharts example : Doughnut Chart

Image
Chart UI key codes explaintion: <Coord type='theta' innerRadius={0.45} /> without 'innerRadius={0.45}', UI will looks like: without below codes, UI will looks like: <Geom select={[false,{}]} type='intervalStack' position='percent'  color={['type', ['rgba(255, 255, 255, 0)']]}  style={{stroke: 'rgba(152,191,182,1)', lineWidth: 1}}>  </Geom> Codes ChartComponent.js import React, { Component } from 'react'; import {Chart, Axis, Tooltip, Geom, Coord, Label} from 'bizcharts'; import DataSet from '@antv/data-set'; const { DataView } = DataSet; export class ScoreChart extends Component { render() { const { width, height, score } = this.props; const scoreData = [ { type: 'Score', value: score }, { type: '', value: 10 - score }, ]; const scoreDv = new DataView(); scoreDv.source(scoreData) .transform({ type: 'pe

sed replace shell variable which include slash ('/')

Test content cat test-sed.txt aaa/bbb/ccc/ddd/eee fff/ggg/ss replace "ccc/ddd" to "CCC/DDD" via sed NEW_STRING="CCC/DDD" sed -i "s:ccc/ddd:${NEW_STRING}:" test-sed.txt Notes: use ':' as seperate char rather than '/', which is default use "" include the replace command

Await is a reserved word error

Solution: In order to use await, the function directly enclosing it needs to be async. example codes: async tryGetUserName() { let session = await Auth.currentSession(); ...... } async should be there, otherwise you will get the error.

Fix up: Can't Load URL: The domain of this URL isn't included in the app's domains.

Image
Issue Can't Load URL: The domain of this URL isn't included in the app's domains. To be able to load this URL, add all domains and subdomains of your app to the App Domains field in your app settings. Scenario create a facebook app to get an appid use that appid in website to initialized the facebook javascript SDK use FB.ui to share content to facebook full source codes <!-- init facebook js sdk via your appid --> <script> window.fbAsyncInit = function() { FB.init({ appId : 'yourappid', autoLogAppEvents : true, xfbml : true, version : 'v3.1' }); }; (function(d, s, id){ var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) {return;} js = d.createElement(s); js.id = id; js.src = "https://connect.facebook.net/en_US/sdk.js"; fjs.parentNode.insertBefore(js, fjs); }(document, 'script', 'facebook-jssdk'

connect shadowsocks server on ubuntu via ss-local

#Server config [Set up your own shadowsocks server](https://errong.win/2018/06/05/setup-shadowsocks-on-ubuntu-16-04/) or found/buy one. You should have a shadowsocks server with below informations: * server ip * server port * password * method #install ~~~ sudo apt-get install software-properties-common -y sudo add-apt-repository ppa:max-c-lv/shadowsocks-libev -y sudo apt-get update sudo apt install shadowsocks-libev ~~~ #configure match to the server's info. ~~~ sudo vim /etc/shadowsocks-libev/config.json {     "server":"xx.xx.xx.xx", // server IP     "server_port":8911,     "local_port":1008, // local port     "password":"jesuslove",     "timeout":60,     "method":"chacha20-ietf-poly1305" } ~~~ #run ss-local ```sudo ss-local -c  /etc/shadowsocks-libev/config.json``` #export socks proxy system wide ~~~ export http_proxy=socks5://127.0.0.1:1008 export https_proxy=socks5://127.0.0.1:1008 ~~~ #u