Skip to content

Instantly share code, notes, and snippets.

@madhums
madhums / serializeHash.js
Created October 4, 2012 23:51
jquery form serialize hash
var serializeHash = function () {
var attrs = {};
$.each($(this).serializeArray(), function(i, field) {
attrs[field.name] = field.value;
});
return attrs;
};

Is this article related to a climate event?

Metrics:

  • How will I know if an article covers climate event?
  • What do we consider as climate event?

Output: label: Climate event

@madhums
madhums / docker-compose.yml
Created August 15, 2019 08:02
docker with nginx and php-fpm
version: '3.3'
services:
php:
image: php:7.1-fpm
volumes:
- .:/var/www/html
working_dir: /var/www/html
networks:
- web

Keybase proof

I hereby claim:

  • I am madhums on github.
  • I am madhums (https://keybase.io/madhums) on keybase.
  • I have a public key ASBVMIs9eqWnfu0aNDPJA5_wKDQv66UV2VaW4wuo7Ev5VQo

To claim this, I am signing this object:

@madhums
madhums / expressjs-base64-image.js
Created March 9, 2012 09:02 — forked from hackable/expressjs-base64-image.js
Node.js base64 encode a downloaded image for use in data URI
express = require("express")
request = require("request")
BufferList = require("bufferlist").BufferList
app = express.createServer(express.logger(), express.bodyParser())
app.get "/", (req, res) ->
if req.param("url")
url = unescape(req.param("url"))
request
uri: url
encoding: 'binary'
@madhums
madhums / dc-movies-in-order.md
Created April 27, 2019 17:04
dc movies to watch in order

DC Movies in order

  1. Man of Steel (2013)
  2. Dawn of Justice (2016)
  3. Suicide Squad (2016)
  4. Wonder Woman (2017)
  5. Justice League (2017)
  6. Aquaman (2018)
  7. Shazam! (2019)
@madhums
madhums / README.md
Last active February 20, 2019 14:51
tslint prettier and atom

Tslint with Prettier on Atom

Install linter, linter-ui-default and linter-tslint packages on Atom.

Run below to detect errors:

$ npx tslint --project tsconfig.json --config tslint.json
@madhums
madhums / wave.css
Created November 22, 2018 22:35
making a wave like structure in css (https://jsfiddle.net/7fjSc/9/)
#wave {
position: relative;
height: 70px;
width: 600px;
background: #e0efe3;
}
#wave:before {
content: "";
display: block;
@madhums
madhums / mongod
Created July 19, 2011 12:02
mongod init script. Placed in /etc/init.d/mongod
#! /bin/sh
### BEGIN INIT INFO
# Provides: mongodb
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mongodb startup script
# Description: Mongodb start stop daemon sends SIGINT to terminate
# say man signal to see details
# Please check the startup params and replication options
@madhums
madhums / moveable-modal.js
Last active June 14, 2018 11:54
Making angular-ui bootstrap modal moveable
'use strict';
/**
* Moveable modal
*
* You need to set the options of the provider.
*
* Requirements:
*
* You need angular-ui/bootstrap module