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 util = require('util'); | |
| const FileType = require('file-type'); | |
| var mmm = require('mmmagic'), | |
| Magic = mmm.Magic; | |
| var magic = new Magic(mmm.MAGIC_MIME_TYPE); | |
| const exec = util.promisify(require('child_process').exec); | |
| (async () => { | |
| console.log('FileType csv', await FileType.fromFile('/path/to/file-name.csv')); | |
| console.log('FileType png', await FileType.fromFile('/path/to/file-name.png')); | |
| magic.detectFile('/path/to/file-name.csv', (err, res) => | 
  
    
      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 fs = require('fs'); // npm i fs | |
| const AWS = require('aws-sdk'); // npm i aws-sdk | |
| const arguments = {}; | |
| process.argv.forEach(arg => { | |
| const [index, value] = arg.split("="); | |
| console.log(index, value); | |
| arguments[index] = 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
    
  
  
    
  | function HttpError( | |
| message = 'Unknown', | |
| status = 500, | |
| code = 'InternalServerError' | |
| ) { | |
| this.name = "HttpError"; | |
| this.status = status; | |
| this.code = code; | |
| this.message = message; | |
| this.success = 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
    
  
  
    
  | import semver from 'semver'; | |
| import childProcess from 'child_process'; | |
| import packageJson from './package.json'; | |
| const exec = command => new Promise((resolve) => { | |
| childProcess.exec(command, (error, stdout, stderr) => { | |
| if (error) { | |
| return resolve([error]); | |
| } | |
| if (stderr) { | 
  
    
      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 promise = canReject => new Promise((resolve, reject) => canReject ? reject('bye') : resolve('hi')) | |
| const thenCallback = message => console.log(message); | |
| const catchCallback = message => console.log(message); | |
| promise() | |
| .then(thenCallback) | |
| .catch(catchCallback) | |
| promise(true) | |
| .then(thenCallback) | |
| .catch(catchCallback) | 
  
    
      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
    
  
  
    
  | Step.1 | |
| - download j workbench | |
| - install java | |
| - java -jar ~/Documents/Workbench-Build124/sqlworkbench.jar & | |
| Step.2 | |
| - download postgres driver | |
| Step.3 | |
| - Add path to postgres downloaded zip at AWS Redshift Driver after going to Manager Driver via Menu | 
  
    
      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
    
  
  
    
  | <VirtualHost *:80> | |
| ServerName insertName.youSiteName.com | |
| DocumentRoot /var/www/html/youSiteName.com | |
| ProxyRequests on | |
| <Proxy *> | |
| Order deny,allow | |
| Allow from all | 
  
    
      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
    
  
  
    
  | Alt+Ctrl+T | |
| sudo apt-get update -y | |
| copy paste sudo apt-get install mono-complete -y | |
| cd ~/Downloads | |
| wget http://telerik-fiddler.s3.amazonaws.com/fiddler/fiddler-linux.zip | |
| sudo apt-get install unzip -y | |
| unzip fiddler-linux.zip\?sfvrsn\=2 -d fiddler | |
| cd fiddler/ | |
| mono Fiddler.exe | 
  
    
      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
    
  
  
    
  | # go to the directory where we will keep the codebase for the local sites | |
| cd /var/www/html | |
| git clone githubRepoUrl | |
| sudo apt-get update -y | |
| #install apache2 | |
| sudo apt-get install apache2 | 
  
    
      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
    
  
  
    
  | alias checkoutsites='cd /var/www/html' | |
| # react coverage html dump | |
| alias getCoverageFilesList='git diff --name-only origin/develop | grep -v public/ | grep -v api/ | grep -v styles | grep -v __tests__ | grep -v action_types' | |
| alias startNodeServer='cd /var/www/html/backend && NODE_ENV=local nvm exec v10.12.0 node . &' | |
| alias opensqlworkbench='java -jar ~/Documents/Workbench-Build124/sqlworkbench.jar &' | |
| alias openlocaldb='mysql -h 127.0.0.1 -u root -p1234 -A' | |
| function spacestotab() { | |
| # $1 -> directory # $2 -> regex matching files within the $1 directory $3 -> tabs count, generally being 2 | |
| find $1 -name '$2' ! -type d -exec bash -c 'expand -t ${3:-2} "$0" > /tmp/e && mv /tmp/e "$0"' \{\} \\ |