Skip to content

Instantly share code, notes, and snippets.

View preetham-salehundam's full-sized avatar
🎯
NLP enthusiast, Mars Invader!

Preetham Salehundam preetham-salehundam

🎯
NLP enthusiast, Mars Invader!
View GitHub Profile
@preetham-salehundam
preetham-salehundam / 0_reuse_code.js
Created July 24, 2016 10:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@preetham-salehundam
preetham-salehundam / npm commands
Last active February 12, 2017 07:22
webpack.config.js
npm install -g babel
npm install -g babel-cli
mkdir reactApp
npm init
npm install webpack --save
npm install webpack-dev-server --save
npm install react --save
npm install react-dom --save
npm install babel-core --save-dev
npm install babel-loader --save-dev
var fs = require("fs");
fs.readFile('input.txt', function (err, data) { //callback function
if (err)
return console.error(err);
console.log(data.toString());
});
#!/bin/bash
echo this script name is $0
echo first arg is $1
echo second arg is $2
echo \$$ $$ PID of the script
String file contents
FROM ubuntu:latest
RUN echo "export RSYNC_PROXY=cis-india-pitc-bangalorez.proxy.corporate.ge.com:80;export HTTP_PROXY=https://cis-india-pitc-bangalorez.proxy.corporate.ge.com:80;export HTTPS_PROXY=https://cis-india-pitc-bangalorez.proxy.corporate.ge.com:80;export http_proxy=https://cis-india-pitc-bangalorez.proxy.corporate.ge.com:80;export https_proxy=https://cis-india-pitc-bangalorez.proxy.corporate.ge.com:80;export no_proxy=.ge.com" >> ~/.bashrc & source ~/.bashrc
RUN apt-get update #redo
RUN apt-get install -q -y git
RUN apt-get install -q -y maven
RUN apt-get install -q -y build-essential libssl-dev
RUN curl --insecure https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh -o install_nvm.sh
RUN bash install_nvm.sh;source ~/.profile
RUN nvm install 8.2.1; nvm use 8.2.1
RUN apt-get install -q -y apache2
@preetham-salehundam
preetham-salehundam / upload.js
Created September 10, 2017 14:48
upload file with json
  
$scope.save = function () {          $http({              method: 'POST',              url: "http://localhost:51739/PostFileWithData",              headers: { 'Content-Type': undefined },                           transformRequest: function (data) {                  var formData = new FormData();                  formData.append("model", angular.toJson(data.model));                  for (var i = 0; i < data.files.length; i++) {                      formData.append("file" + i, data.files[i]);                  }                  return formData;              },              data: { model: $scope.jsonData, files: $scope.files }          }).          success(function (data, status, headers, config) {              alert("success!");          }).          error(function (data, status, headers, config) {              alert("failed!");          });      };  }); 
@preetham-salehundam
preetham-salehundam / reports.js
Created October 21, 2017 18:25
filedownload
//for dpod use following code in reports.js
/**
* Please add filesaver.js to script as shown in html
* load filesaver.js using require.js
* replace saveData method with saveAs()
*/
//add the filesaver to require config.js and refer using require('filesaver')
require(['https://cdn.rawgit.com/eligrey/FileSaver.js/e9d941381475b5df8b7d7691013401e171014e89/FileSaver.min.js'])

Keybase proof

I hereby claim:

  • I am preethampatnaik on github.
  • I am preethampatnaik (https://keybase.io/preethampatnaik) on keybase.
  • I have a public key whose fingerprint is EE74 2B22 F631 C8E1 271B 1B66 F101 78D2 B1F4 6ACB

To claim this, I am signing this object:

@preetham-salehundam
preetham-salehundam / git-personal-access-token.conf
Created November 7, 2017 20:21
git-personal-access-token.conf
# After cloning
cd gh-pages
git remote rm origin
git remote add origin https://scuzzlebuzzle:<MYTOKEN>@github.com/scuzzlebuzzle/ol3-1.git