Skip to content

Instantly share code, notes, and snippets.

View mohankumar-i2i's full-sized avatar

Mohan Kumar mohankumar-i2i

  • ideas2it technologies
  • chennai,tamil nadu,India
View GitHub Profile
@mohankumar-i2i
mohankumar-i2i / postman-pre-request.js
Created September 18, 2018 18:30 — forked from bcnzer/postman-pre-request.js
Postman pre-request script to automatically get a bearer token from Auth0 and save it for reuse
const echoPostRequest = {
url: 'https://<my url>.auth0.com/oauth/token',
method: 'POST',
header: 'Content-Type:application/json',
body: {
mode: 'application/json',
raw: JSON.stringify(
{
client_id:'<your client ID>',
client_secret:'<your client secret>',
@mohankumar-i2i
mohankumar-i2i / installing-node-with-nvm.md
Created September 17, 2018 11:56 — forked from d2s/installing-node-with-nvm.md
Installing Node.js for Linux & macOS with nvm
pipeline {
// run on jenkins nodes tha has java 8 label
agent { label 'java8' }
// global env variables
environment {
EMAIL_RECIPIENTS = 'mahmoud.romeh@test.com'
}
stages {
stage('Build with unit testing') {
@mohankumar-i2i
mohankumar-i2i / delete_comments_likes.js
Created May 31, 2018 07:28 — forked from DanTup/delete_comments_likes.js
Delete all Facebook posts for a year
// Only tested in Chrome...
// Must browse to "Your Comments" (or "Your Likes") page of activity feed, then pre-load the year you want to delete
// and as many comments as possible (scroll down, they load lazily).
//
// I ACCEPT ABSOLUTELY NO RESPONSIBILITY FOR THIS DOING BAD STUFF. THE NEXT FACEBOOK DEPLOYMENT
// COULD WELL BREAK THIS, OR MAKE IT DO THINGS YOU DO NOT EXPECT. USE IT AS A STARTING POINT ONLY!
//
// It will start failing once it gets to the end, just reload the page and kick it off again.
var rows = document.querySelectorAll('#year_2012 .pam._5shk');
@mohankumar-i2i
mohankumar-i2i / README.md
Created May 24, 2018 01:09 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

OP: @leonardofed founder @ plainflow.


@mohankumar-i2i
mohankumar-i2i / AutowiringSpringBeanJobFactory.java
Created January 4, 2018 06:23 — forked from jeffsheets/AutowiringSpringBeanJobFactory.java
Configuring Quartz 2.1.7 with Spring 3.1.3 in clustered mode
/**
* Autowire Quartz Jobs with Spring context dependencies
* @see http://stackoverflow.com/questions/6990767/inject-bean-reference-into-a-quartz-job-in-spring/15211030#15211030
*/
public final class AutowiringSpringBeanJobFactory extends SpringBeanJobFactory implements ApplicationContextAware {
private transient AutowireCapableBeanFactory beanFactory;
public void setApplicationContext(final ApplicationContext context) {
beanFactory = context.getAutowireCapableBeanFactory();
}
@mohankumar-i2i
mohankumar-i2i / 0.md
Created November 20, 2017 17:24 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@mohankumar-i2i
mohankumar-i2i / HibernateUtil.java
Created October 22, 2017 16:38 — forked from piyasde/HibernateUtil.java
Multitenancy in Hibernate (with Hibernate 4.3.7 and PostgreSql 9.3.1)
package com.mt;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
private static final SessionFactory sessionFactory;
@mohankumar-i2i
mohankumar-i2i / redis_cheatsheet.bash
Created September 27, 2017 08:40 — forked from LeCoupa/redis_cheatsheet.bash
Redis Cheatsheet - Basic Commands You Must Know
# Redis Cheatsheet
# All the commands you need to know
redis-server /path/redis.conf # start redis with the related configuration file
redis-cli # opens a redis prompt
# Strings.
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');