This file contains 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
_.mixin({ | |
nestedPick: function (obj, wantedKeys) { | |
var resultObj = {}; | |
_.forEach(wantedKeys, function (key) { | |
// Parsing nested keys. Making it so that a[b] equals a.b | |
var nestedKeys = key.replace(/\[(["']?)([^\1]+?)\1?\]/g, '.$2').replace(/^\./, '').split('.') | |
, finalVal = {} | |
, dummy = {} | |
, recVal = obj[nestedKeys[0]] | |
, j = 1 |
This file contains 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
FROM node:5.10 | |
RUN apt-get -y update && apt-get clean | |
RUN apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3 && \ | |
echo "deb http://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list && \ | |
apt-get update && apt-get install yarn | |
RUN yarn global add pm2 | |
ADD . /srv/www | |
WORKDIR /srv/www |
This file contains 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
FROM node:12 | |
COPY . /app | |
WORKDIR /app | |
RUN npm install | |
CMD ["npm", "test"] |
This file contains 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
ORG_FILES=`find app/**/*.js` | |
for i in $(echo $ORG_FILES | tr ";" "\n"); do | |
NEW_FILE=`echo $i | sed "s/\.js/\.ts/g"` | |
mv $i $NEW_FILE | |
done |
This file contains 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
name: Auto PR Review | |
on: [pull_request] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v1 |
This file contains 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 https = require('https'); | |
const { SocksProxyAgent } = require('socks-proxy-agent'); | |
const agent = new SocksProxyAgent('socks5h://127.0.0.1:9050'); | |
https.get('https://ifconfig.me', { | |
agent | |
}, res => { | |
res.pipe(process.stdout); | |
}); |
This file contains 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 { SocksProxyAgent } = require('socks-proxy-agent'); | |
const axios = require('axios'); | |
const agent = new SocksProxyAgent('socks5h://127.0.0.1:9050'); | |
axios({ | |
url: 'https://ifconfig.me', | |
httpsAgent: agent, | |
}) | |
.then(({ |
This file contains 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
{ | |
"widgets": [ | |
{ | |
"name": "WidgetA", | |
"cdnURL": "....A" | |
}, | |
{ | |
"name": "WidgetB", | |
"cdnURL": "....B" | |
} |
This file contains 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
function Welcome(props) { | |
return <h1>Hello, {props.name}</h1>; | |
} |
This file contains 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
interface WelcomeProps { | |
name: string; | |
children: React.ReactNode; | |
} | |
function Welcome(props: WelcomeProps) { | |
return <h1>Hello, {props.name}</h1>; | |
} |
OlderNewer