Skip to content

Instantly share code, notes, and snippets.

View codeaholicguy's full-sized avatar
🎯
Focusing

Nguyễn Nhật Hoàng codeaholicguy

🎯
Focusing
View GitHub Profile
const targetPage = 'https://services.giaohangtietkiem.vn/*'
const addTokenHeader = (e) => {
e.requestHeaders.push({name: 'Token', value: 'token'})
return {requestHeaders: e.requestHeaders}
}
browser.webRequest.onBeforeSendHeaders.addListener(
addTokenHeader,
{urls: [targetPage]},
['blocking', 'requestHeaders']
{
"permissions": [
"webRequest",
"webRequestBlocking",
"https://services.giaohangtietkiem.vn/"
],
"background": {
"scripts": ["background.js"]
}
}
{
"scripts": {
"build": "NODE_ENV=production parcel build src/index.html -d dist --detailed-report --no-source-maps",
"clean": "rimraf dist",
"prebuild": "yarn run clean && mkdir dist && cp -R src/public/* dist",
}
}
{
"manifest_version": 2,
"name": "Giao hàng tiết kiệm",
"description": "Giao hàng tiết kiệm",
"version": "0.0.1",
"browser_action": {
"default_popup": "index.html",
"default_title": "Open the popup"
},
"icons": {
@codeaholicguy
codeaholicguy / .gitconfig_difftool
Last active June 13, 2018 08:53
Use nvim as difftool
[merge]
tool = vimdiff
[mergetool]
prompt = true
[mergetool "vimdiff"]
cmd = nvim -d $LOCAL $MERGED $MERGED -c '$wincmd w' -c '$wincmd J'
[difftool]
prompt = false
[diff]
tool = vimdiff
@codeaholicguy
codeaholicguy / cmd
Created May 18, 2018 07:57
Apache bench
ab -n 10000 http://localhost:4000/
@codeaholicguy
codeaholicguy / install.md
Last active April 17, 2018 05:57
Install mySQL on macOS

Install

Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install MySQL

$ brew install mysql

Additional configuration

Homebrew

class IndexPage extends React.Component {
constructor(props) {
super(props)
this.state = {show: false}
}
componentDidUpdate() {
if (this._el) {
lottie.loadAnimation({
class IndexPage extends React.Component {
constructor(props) {
super(props)
this.state = {show: false}
}
_click = () => {
this.setState({show: true})
class IndexPage extends React.Component {
componentDidMount() {
lottie.loadAnimation({
container: this._el,
renderer: 'svg',
animationData: animation,
})
}
render() {