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
// use via | |
// jscodeshift -t all.js src | |
// | |
const sourceOptions = { quote: 'single' } | |
/** | |
* Removes the named import: PropTypes | |
*/ | |
const removeNamedImportPropTypes = (file, api) => { | |
const j = api.jscodeshift |
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
import * as Lib from 'lib'; | |
console.log('APP'); | |
console.log(Lib); | |
console.log(Lib.capitalize('hello world')); |
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
var net = require('net'); | |
net.createServer(httpsSshSwitch).listen(443); | |
// if the first byte is 22, it is a https handshake, | |
// so redirect it to the actual https server (running on port 8443) | |
// else redirect it to the ssh instance. | |
// | |
// some ssh clients wait for the server to send the first welcome message | |
// so if we have not seen any data for 2 seconds, assume it is a ssh connection |