Skip to content

Instantly share code, notes, and snippets.

View nigilan's full-sized avatar
🎯
Focusing

Nigilan Palanisamy nigilan

🎯
Focusing
View GitHub Profile
@nigilan
nigilan / app.js
Created May 13, 2018 13:18
To pass port in command line and also to close the server
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send({"mess": "hello world"});
});
const portArrayPointer = process.argv.indexOf("--port");
if (portArrayPointer) {
import Ember from 'ember';
import EmberObject from '@ember/object';
let India = EmberObject.create({
capital : 'New Delhi'
});
let China = EmberObject.create({
capital : 'Beijing'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
@nigilan
nigilan / winstonLogger.js
Created November 3, 2017 11:40
Winston logger and daily rotator
/**
* Configurations of logger.
*/
const winston = require('winston');
process.env.NODE_ENV = "production";
const env = process.env.NODE_ENV;
const fs = require('fs');
var util = require('util');
const logDir = 'applicationlog';
@nigilan
nigilan / npmsetup.ps1
Created September 26, 2017 15:11
This piece of code is to run commands in powershell as administrator.
Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force
# Get the ID and security principal of the current user account
$myWindowsID = [System.Security.Principal.WindowsIdentity]::GetCurrent();
$myWindowsPrincipal = New-Object System.Security.Principal.WindowsPrincipal($myWindowsID);
# Get the security principal for the administrator role
$adminRole = [System.Security.Principal.WindowsBuiltInRole]::Administrator;
# Check to see if we are currently running as an administrator