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 / eventListener.js
Created June 2, 2016 17:37
Add listener to dispatch events
var utitlity = (function(){
'use strict';
var observerList = [];
var observe = function (eventName, eventMethod) {
observerList[eventName] = eventMethod;
};
var dispatch = function (eventName, eventParams){
eventParams = eventParams || '';
@masudiiuc
masudiiuc / app.js
Last active October 7, 2015 23:02
Write a simple TodoList using AngularJS
'use strict';
var todoAppliction = angular.module("todoApp",[]);
todoAppliction.controller("todoController", todoController);
todoController.$inject =['$scope'];
/**
* Processs an input box enter event
* Ex: on enter add the task in the list
@masudiiuc
masudiiuc / git-profile
Last active August 29, 2015 14:27
Git-profile
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
# Screenshot: http://i.imgur.com/s0Blh.png
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
@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'};
@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;
}
# ---------------------------------------------------------------------------
#
# 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 / 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
@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 / 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
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",