Skip to content

Instantly share code, notes, and snippets.

View dileepunni1's full-sized avatar

Dileep stanley george dileepunni1

  • accenture.com
  • Rome
View GitHub Profile
/**
* Summernote StripTags
*
* This is a plugin for Summernote (www.summernote.org) WYSIWYG editor.
* To strip unwanted HTML tags and attributes while pasting content in editor.
*
* @author Hitesh Aggarwal, Extenzine
*
*/
@dileepunni1
dileepunni1 / object-to-form-data.js
Created August 30, 2019 10:24 — forked from ghinda/object-to-form-data.js
JavaScript Object to FormData, with support for nested objects, arrays and File objects. Includes Angular.js usage.
// takes a {} object and returns a FormData object
var objectToFormData = function(obj, form, namespace) {
var fd = form || new FormData();
var formKey;
for(var property in obj) {
if(obj.hasOwnProperty(property)) {
if(namespace) {
// Simple JavaScript Templating
// John Resig - https://johnresig.com/ - MIT Licensed
(function(){
var cache = {};
this.tmpl = function tmpl(str, data){
// Figure out if we're getting a template, or if we need to
// load the template - and be sure to cache the result.
var fn = !/\W/.test(str) ?
cache[str] = cache[str] ||
@dileepunni1
dileepunni1 / index.html
Created November 16, 2017 14:44
RxJS 5 Operators // source http://jsbin.com/koyuni
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>RxJS 5 Operators</title>
<script src="https://npmcdn.com/@reactivex/rxjs@5.0.0-beta.3/dist/global/Rx.umd.js"></script>
</head>
<body>
body {
font: 90%/1.45em "Helvetica Neue", HelveticaNeue, Verdana, Arial, Helvetica, sans-serif;
margin: 0;
padding: 0;
color: #333;
background-color: #fff;
}
div.container {
min-width: 980px;
@dileepunni1
dileepunni1 / cluster.js
Last active May 2, 2016 14:13
Gist for using nodejs cluster with forever and start child process equal to the core available on server. every thing managed using a make file. Forever install using -g switch.
/**
* Libraries
**/
var cluster = require('cluster');
var datefmt = require('dateformat');
var numCPUs = require('os').cpus().length;
/**
* Setup
**/
@dileepunni1
dileepunni1 / Makefile
Created May 2, 2016 13:21 — forked from jmervine/Makefile
Node.js forever Makefile tasks.
#
# Tasks
#
# - start :: starts application using forever
# - stop :: stops application using forever
# - restart :: restart application using forever
#
# This set's your local directory to to your NODE_PATH
NODE_EXEC = NODE_PATH=.:$(NODE_PATH)
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../paper-item/paper-item.html">
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<link rel="import" href="../chart-js/chart-js.html">
<link rel="import" href="../smoothie-chart/smoothie-chart.html">
Here is a simple jQuery plugin to make a table header fixed on top when window is scrolled.
Using the code from twitter bootstrap documentation page, this code is customized for table header.
Create the table with following layout -
<table class="table-fixed-header">
<thead class="header">
<tr>
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>