Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

Nigilan Palanisamy nigilan

🎯
Focusing
Block or report user

Report or block nigilan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View index.html
<!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">
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
nigilan / app.js
Created May 13, 2018
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
nigilan / winstonLogger.js
Created Nov 3, 2017
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
nigilan / npmsetup.ps1
Created Sep 26, 2017
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
You can’t perform that action at this time.