Skip to content

Instantly share code, notes, and snippets.

View sivaprabug's full-sized avatar
🏠

Sivaprabu Ganesan sivaprabug

🏠
View GitHub Profile
@sivaprabug
sivaprabug / postman.js
Created July 5, 2017 10:23
Set cookie value and csrf value as global postaman value
tests["Status code is 200"] = responseCode.code === 200;
// getting CSRF token value from responseBody and stored in global variable
var data = JSON.parse(responseBody);
console.info("CSRF Token Value = " + data.CSRFToken);
postman.setGlobalVariable("csrftoken", data.CSRFToken);
// getting QSESSIONID value from Cookie and stored in global variable
var qsessionidValue = postman.getResponseCookie("QSESSIONID").value
console.log(qsessionidValue);
@sivaprabug
sivaprabug / Gruntfile.js
Last active July 1, 2017 00:46
How to remove the console logs in my minified/compresed js files using below Gruntfile.js ?
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
// Wipe out previous builds and test reporting.
clean: ["dist/", "test/reports"],
// Run your source code through JSHint's defaults.
jshint: {
options: {
laxcomma: true,
'-W086': true,
@sivaprabug
sivaprabug / parseint.html
Last active May 4, 2017 15:04
Confusing string/number with parseInt() Using JavaScript
<!DOCTYPE html>
<html>
<head>
<title> Confusing string/number using JavaScript</title>
<h1 align="center"><u> Confusing string/number with parseInt() Using JavaScript</u></h1>
</head>
<body>
<script type="text/javascript">
@sivaprabug
sivaprabug / users.json
Created February 10, 2017 00:29
Just call test purpose user credetial
[{
"firstName": "Sivaprabu",
"lastName": "Ganesan",
"userName": "gsivaprabu",
"password": "gsivaprabu",
"age": 32,
"address": {
"streetAddress": "Kamaraj Nagar",
"city": "Namakkal",
"state": "Tamil Nadu",
@sivaprabug
sivaprabug / ipv6Validation.html
Last active January 12, 2017 13:37
Remove [ and ] in ipv6 address using JavaScript
<!DOCTYPE html>
<html>
<head>
<title> Remove [ and ] in ipv6 address using JavaScript</title>
<h1 align="center"><u> Remove [ and ] in ipv6 address using JavaScript</u></h1>
<script>
var ipv6 = '[2001:0db8:0000:0000:0000:ff00:0042:8329]';
// var ipv6 = '10.0.124.75';
ipv6 = ipv6.replace(/[\]\[]/g, '');
@sivaprabug
sivaprabug / ClosureInJavaScript.html
Created December 23, 2016 13:40
Closure concept in JavaScript
Closure concept in JavaScript
@sivaprabug
sivaprabug / broadcast.html
Created December 23, 2016 11:37 — forked from anonymous/gist:cd9762a69dd744d6093bd826c42d6eb1
Broadcast concepts in AngularJS
<!DOCTYPE html>
<html>
<head>
<title>Broadcasting</title>
<script src="js/angular.min.js"></script>
<script>
var app = angular.module('app', []);
app.controller("firstCtrl", function ($scope) {
$scope.handleClick = function (msg) {
@sivaprabug
sivaprabug / DebuggerInJavaScript.html
Last active December 23, 2016 06:12
Debugger in JavaScript
<!DOCTYPE html>
<html>
<head>
<title>Debugger in JavaScript</title>
<h1 align="center"><u>Debugger in JavaScript</u></h1>
<script>
function testingPurpose() {
debugger;
console.log('debugger');
@sivaprabug
sivaprabug / InheritanceJavaScriptObject.html
Last active December 23, 2016 05:49
How to create inheritance of an JavaScript object ?
<!DOCTYPE html>
<html>
<head>
<title>Debugger in JavaScript</title>
<h1 align="center"><u>Debugger in JavaScript</u></h1>
<script>
function testingPurpose() {
debugger;
console.log('debugger');
@sivaprabug
sivaprabug / eTag-cache.php
Created December 8, 2016 10:45
PHP Cache and ETag Concept
<?php
// Start output buffering, this will
// catch all content so that we can
// do some calculations
ob_start();
// Some example HTML
print '<html>';