Skip to content

Instantly share code, notes, and snippets.

View ozantunca's full-sized avatar

Ozan Tunca ozantunca

View GitHub Profile
'lorem ipsum dolor sit amet'.replace(' ', '-');
// -> 'lorem-ipsum dolor sit amet'
'lorem ipsum dolor sit amet'.replaceAll(' ', '-');
// -> 'lorem-ipsum-dolor-sit-amet'
interface WelcomeProps {
name: string;
}
const Welcome: React.FC<WelcomeProps> = (props) => <h1>Hello, {props.name}</h1>;
interface WelcomeProps {
name: string;
children: React.ReactNode;
}
function Welcome(props: WelcomeProps) {
return <h1>Hello, {props.name}</h1>;
}
function Welcome(props) {
return <h1>Hello, {props.name}</h1>;
}
{
"widgets": [
{
"name": "WidgetA",
"cdnURL": "....A"
},
{
"name": "WidgetB",
"cdnURL": "....B"
}
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(({
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);
});
name: Auto PR Review
on: [pull_request]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
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