- You have to run proxy server on you machine. Download SquidMan UI app of squid proxy. (Unfortunately this app is MacOS only. For Windows user, try alternative proxy server app)
- Setting up, at
Preferences > General
set desire port for proxy server toHTTP Port:
(default is8080
) - Config ip addresses that can access this proxy in
Preferences > Clients
- press
New
- enter ip and subnet you want ie.
192.168.1.0/24
- press
- Disable localhost apps protection, go to
Preferences > Template
scroll and findhttp_access deny to_localhost
and comment the line by adding#
in front of it.
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
/** | |
* React-app-rewired, tweaking configs without ejecting create-react-app project | |
* | |
* 1. yarn add react-app-rewired babel-plugin-transform-decorators-legacy | |
* 2. copy this file to root (same as node_modules) and name it as 'config-overrides.js' | |
* 3. you can add more plugins if want, if not, skip to (4.) | |
* 4. edit package.json script to use 'react-app-rewired' instead of 'react-scripts' | |
* | |
* "scripts": { | |
* "start": "react-app-rewired start", |
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 { configure } from '@storybook/react' | |
// each filename returns as "./_Component.js" | |
const req = require.context('../src/stories', true, /^(\.\/_)(.+)(\.js$)/) | |
// Explicitly require load stories | |
// function loadStories() { | |
// // require('../src/stories'); | |
// req.keys().forEach(filename => req(filename)) | |
// } |
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
var storage = { | |
key: 'yammer_draft', | |
save: function(data) { | |
localStorage.setItem(this.key, JSON.stringify(data)) | |
}, | |
get: function() { | |
return JSON.parse(localStorage.getItem(this.key)) | |
} | |
} |
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
/** | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
return _.transform(object, (result, value, key) => { | |
if (!_.isEqual(value, base[key])) { | |
result[key] = _.isObject(value) && _.isObject(base[key]) ? difference(value, base[key]) : value |
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
# pure.zsh is located at /usr/local/lib/node_modules/pure-prompt/pure.zsh | |
# Pure @1.8.0 | |
# by Sindre Sorhus | |
# https://github.com/sindresorhus/pure | |
# MIT License | |
# For my own and others sanity | |
# git: | |
# %b => current branch |
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
// 🔥 Node 7.6 has async/await! Here is a quick run down on how async/await works | |
const axios = require('axios'); // promised based requests - like fetch() | |
function getCoffee() { | |
return new Promise(resolve => { | |
setTimeout(() => resolve('☕'), 2000); // it takes 2 seconds to make coffee | |
}); | |
} |
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
const fetch = require('isomorphic-unfetch') | |
const fs = require('fs') | |
const path = require('path') | |
const https = require('https') | |
// by-pass self-signed certificate rejection on local server | |
const agent = new https.Agent({ | |
rejectUnauthorized: false, | |
}) |
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
Show hidden characters
[ | |
{ "keys": ["ctrl+j"], "command": "find_under_expand" }, | |
{ "keys": ["ctrl+shift+j"], "command": "find_all_under" }, | |
{ "keys": ["super+d"], "command": "duplicate_line" }, | |
{ "keys": ["alt+shift+up"], "command": "swap_line_up" }, | |
{ "keys": ["alt+shift+down"], "command": "swap_line_down" }, | |
] |
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 _ from 'lodash' | |
// This is based on a PR which fixed collection.count deprecation warning | |
// https://github.com/edwardhotchkiss/mongoose-paginate/blob/e807d87b02aca2198f4fb2e5e896e6aad4b77f55/index.js | |
// but only god knows when the PR will get merged, so here we are, create our own fork. | |
// Now with aggregateMode support!!. | |
/** | |
* mongoose-paginate | |
* @param {Object|Array} [query={}] - this must be array when using aggregate mode (options.aggregateMode = true) |
OlderNewer