Skip to content

Instantly share code, notes, and snippets.


Nigilan Palanisamy nigilan

View GitHub Profile
View index.html
<!DOCTYPE html>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<script id="jsbin-javascript">
View controllers.application.js
import Ember from 'ember';
import EmberObject from '@ember/object';
let India = EmberObject.create({
capital : 'New Delhi'
let China = EmberObject.create({
capital : 'Beijing'
nigilan / app.js
Created May 13, 2018 13:18
To pass port in command line and also to close the server
View app.js
const express = require('express');
const app = express();
app.get('/', (req, res) => {
res.send({"mess": "hello world"});
const portArrayPointer = process.argv.indexOf("--port");
if (portArrayPointer) {
nigilan / winstonLogger.js
Created November 3, 2017 11:40
Winston logger and daily rotator
View winstonLogger.js
* 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 / npmsetup.ps1
Created September 26, 2017 15:11
This piece of code is to run commands in powershell as administrator.
View npmsetup.ps1
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