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 removeFromText(text, strToBeRemoved) { | |
return text.replace(new RegExp(strToBeRemoved, 'g'), ''); | |
} |
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
removeFromText('lorem ipsum dolor sit amet', ' '); | |
// -> 'loremipsumdolorsitamet' ✅ works | |
removeFromText('lorem+ipsum+dolor+sit+amet', '+'); | |
// -> throws error ❌ | |
removeFromText('lorem+ipsum+dolor+sit+amet', '+'); | |
// -> still throws error ❌ | |
removeFromText('lorem+ipsum+dolor+sit+amet', '\\+'); |
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 removeFromText(text, strToBeRemoved) { | |
return text.split(strToBeRemoved).join(''); | |
} | |
removeFromText('lorem+ipsum+dolor+sit+amet', '+'); | |
// -> 'loremipsumdolorsitamet' ✅ |
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; | |
} | |
const Welcome: React.FC<WelcomeProps> = (props) => <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>; | |
} |
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
{ | |
"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
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
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
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 |