Skip to content

Instantly share code, notes, and snippets.

View masudiiuc's full-sized avatar

Md Mahabubul Hasan Masud masudiiuc

View GitHub Profile
@masudiiuc
masudiiuc / Creating Virtual host with a single shell script
Created September 27, 2013 16:45
Creating Virtual host with a single shell script
#!/bin/bash
#---------------------------------------------------------------
# Create a virtual host automatically with host name and
# document root send by parameter
#
# SYNTAX:
# sudo script_name HOST_NAME DOCUMENT_ROOT
#
# EXAMPLE:
@masudiiuc
masudiiuc / CustomDateManager.html
Last active January 3, 2016 10:19
CustomDateManager has the following functionality : 1. Date change with prev, next and custom date selection 2. Week change with prev, next and custom date selection 3. Date range selection with date range picker
<!-- required CSS Files -->
<link href="views/css/bootstrap_3/bootstrap.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="views/css/bootstrap_3/date-picker/daterangepicker.css" rel="stylesheet" type="text/css" media="screen"/>
<link href="views/css/bootstrap_3/date-picker/datetimepicker.css" rel="stylesheet" type="text/css" media="screen"/>
<!-- required JS libraries -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript" src="views/js/bootstrap_3/bootstrap.min.js"></script>
<script type="text/javascript" src="views/js/bootstrap_3/date-picker/moment.min.js"></script>
<script type="text/javascript" src="views/js/bootstrap_3/date-picker/daterangepicker.js"></script>
@masudiiuc
masudiiuc / gist:8825509
Created February 5, 2014 15:01
Solution: MongoDB unable to connect due to sudden shutdown of machine....
Step 1: Remove lock file.
sudo rm /var/lib/mongodb/mongod.lock
Step 2: Repair mongodb.
mongod --repair
Step 3: start mongodb.
sudo start mongodb
or
sudo service mongodb start
Note: I've left some of the full package names in tact to show exactly where the class comes from.
#### Pull dependencies in using composer ####
//Example composer.json
{
"require": {
"symfony/config" : "2.1.0",
"symfony/yaml" : "2.1.0",
"twig/twig": "1.9.0",
@masudiiuc
masudiiuc / GmapUtility.1.1.1.js
Last active August 29, 2015 14:13
Google Map distance calculation using direction service
/**
* Google Map distance calculation using direction service
*
* @author M.M.H.Masud<masudiiuc@gmail.com>
* @date 28th Oct, 2014
* @url https://developers.google.com/maps/documentation/javascript/directions
*
* @todo
* 1. set "optimizewaypoints" to get best directions and best route
* 2. set "unitSystem" for geting distance in Mile or Kilometers
@masudiiuc
masudiiuc / gist:bb5056b263aace3fd772
Created January 7, 2015 21:33
Monitor all you Sql Instances Backups from One Location
### Code that can be used to Monitor all you Sql Instances Backups from One Location
#Create a new Excel object using COM
$ErrorActionPreference = “silentlycontinue”
$Excel = New-Object -ComObject Excel.Application
$Excel.visible = $False
@masudiiuc
masudiiuc / Git and Git-flow learning resources
Created February 23, 2015 23:30
Git and Git-flow learning resources
Git introduction in place of SVN in Granbury Solutions
SVN is going to be replaced with Git (based on Bitbucket) from 28th Feb, 2015. So its better if every try Git from now as a test basis. To get start with Git, create an account in Bitbucket and create your own repository and start working with that one.
Git Client for Cross platform users:
====================================
1. SmartGit -> Windows/Linux/Mac (Best) http://www.syntevo.com/smartgit/early-access?referrer=program&edition=foundation
2. TortaigeGit -> Windows
3. sourceTree -> Mac users
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@masudiiuc
masudiiuc / html2js.php
Last active August 29, 2015 14:26
html2js
#!/usr/bin/env php
<?php
function bundleHtml($file)
{
$html = file_get_contents($file);
$html = str_replace(array("\r\n", "\n", "\r"), " ", $html);
$html = str_replace("'", "\\'", $html);
$html = preg_replace("/\s+/", " ", $html);
return $html;
}
@masudiiuc
masudiiuc / Render.js
Created July 31, 2015 04:30
Rendering Template
function render (templateName, data) {
//Configuration variable for Template
_.templateSettings.variable = "data";
var template = _.template(templateName);
return template(data);
}
render(Templates.sidebar, {'content' : 'YOUR_CONTENT'};