Skip to content

Instantly share code, notes, and snippets.

View thesabbir's full-sized avatar

Sabbir Ahmed thesabbir

View GitHub Profile
@thesabbir
thesabbir / app.js
Last active October 18, 2015 06:20
Angular Directive Example
var App = angular.module("App",[]);
App.controller('main',['$scope', function($scope){
$scope.message="Welcome to Tiny App";
$scope.box = { "content" : "This is a Box "};
}]);
App.directive('boxy', function() {
return {
restrict: 'E',
template: '<div class="box">{{box.content}}</div>'
@thesabbir
thesabbir / GulpFile.js
Created September 19, 2014 08:38
Gulpfile With less
'use strict';
var gulp = require('gulp'),
server = require('gulp-webserver'),
uglify = require('gulp-uglify'),
concat = require('gulp-concat'),
minifycss = require('gulp-minify-css'),
prefixer = require('gulp-autoprefixer'),
less = require('gulp-less'),
inject = require("gulp-inject"),
angularFilesort = require('gulp-angular-filesort'),
@thesabbir
thesabbir / bootstrap.js
Created September 24, 2014 05:26
Run Gulp With Sails lift
/**
* Bootstrap
* (sails.config.bootstrap)
*
* An asynchronous bootstrap function that runs before your Sails app gets lifted.
* This gives you an opportunity to set up your data model, run jobs, or perform some special chalkic.
*
* For more information on bootstrapping your app, check out:
* http://sailsjs.org/#/documentation/reference/sails.config/sails.config.bootstrap.html
*/
@thesabbir
thesabbir / profile.sh
Created November 11, 2014 21:37
OpenWRT ash profile file
#!/bin/sh
[ -f /etc/banner ] && cat /etc/banner
export PATH=/usr/bin:/usr/sbin:/bin:/sbin
export HOME=$(grep -e "^${USER:-root}:" /etc/passwd | cut -d ":" -f 6)
export HOME=${HOME:-/root}
export PS1='\u@\h:\w\$ '
[ -x /bin/more ] || alias more=less
[ -x /usr/bin/vim ] && alias vi=vim || alias vim=vi
#cloud-config
# Set Hostname
hostname: CoreOS
# Set SSH Keys
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCcHGg1Ew4BkdElacPY7vwx1DGfnbfXMk+zv8Knze3HLCqK4vGB7NYj4C6jBt/E81Of2uBoBSriBQ8Nyl3yRuZgcQE7WmeDAoRa1l94gFkn9w5guFKAxzr1zRslM+u8RgGVRy5cMCz4DPPU313A4OukzlqjAXl6MtoDpIbhW6OhsOgWvTpZDAfdWiSONW25t1SGu/H4eqQuGi82iL8z0bMZqwt4JGVt0h1R9FiYtonunHgZUNDllmPnLX2yCNyjSXWvKPOtqCUlk7t2g10Kf7V9OpHoSCxWIdscIXpmvpjTWrsIKjSWPO7B4oNyS9SRRB0ojW1wEh8VZLKTEOghVDAX thesabbir@buntu
coreos:
var fs = require('fs');
var path = require('path');
var movie_path = '/media/thesabbir/Media/Others/Movies/';
var website_url = 'http://localhost:3000/';
//var movie_path = '/home/thesabbir/Documents/mv/';
function fileFilter(files, extension) {
var regExp = new RegExp('\\.' + extension + '$');
return files.filter(regExp.test.bind(regExp));
// Returns an Array of files
"""
Author : Sabbir Ahmed <mail[at]thesabbir.com>
* This module scans specific file type (video) in given paths
* Gets their metadata (Guessit)
* Returns or Insert them into MongoDB
"""
import os
import fnmatch
@thesabbir
thesabbir / index.html
Created November 26, 2014 06:48
node webkit
<!doctype html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title>Window Menu Example</title>
<script>
var nw = require('nw.gui');
@thesabbir
thesabbir / default
Created December 13, 2014 21:11
My Nginx Default Config for PHP development.
server {
listen 80;
root /home/thesabbir/Projects/php;
index index.php index.html index.htm;
server_name php.dev;
location / {
autoindex on;
@thesabbir
thesabbir / index.html
Created January 11, 2015 04:58
WebRTC example by LLC // source http://jsbin.com/galoxu
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="WebRTC example by LLC" />
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<h3>You Will Appear Here If you allow this page to use your camera.</h3>