Skip to content

Instantly share code, notes, and snippets.

View proshanto's full-sized avatar

Proshanta Barman proshanto

  • Brain Station 23 PLC
  • Dhaka, Bangladesh
View GitHub Profile
# coding: utf-8
# FILE:
# -----
# /mnt/Vancouver/apps/Webcam-Face-Detect/webcam_cv3_v2_fps_v3.py
# FUNCTIONALITY:
# --------------
# * outputs webcam to screen and finds faces, eyes
# * writes webcam video to *.avi file (MJPG codec) via OpenCV/FourCC
# -*- coding: utf-8 -*-
from django.http import HttpResponseRedirect
from django.conf import settings
from re import compile
from django.core.urlresolvers import reverse
def get_login_url():
@proshanto
proshanto / homestead-manual-install.md
Created August 15, 2016 11:52 — forked from idecardo/homestead-manual-install.md
Laravel Homestead Manual Installation

Getting Started

Laravel Homestead is an official, pre-packaged Vagrant box that provides you a wonderful development environment without requiring you to install PHP, HHVM, a web server, and any other server software on your local machine. Read more...

Download

Download homestead box using this link:

@proshanto
proshanto / beautiful_idiomatic_python.md
Created December 8, 2015 16:11 — forked from JeffPaine/beautiful_idiomatic_python.md
Transforming Code into Beautiful, Idiomatic Python: notes from Raymond Hettinger's talk at pycon US 2013. The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@proshanto
proshanto / Default (Linux).sublime-keymap
Created August 11, 2015 13:10
Sublime Text 3 Themes, Schemes, Packages and Config
[
{ "keys": ["ctrl+t"], "command": "side_bar_new_file2" },
{ "keys": ["ctrl+shift+o"], "command": "prompt_open_folder" },
]
@proshanto
proshanto / gist:0ee52eec4738d2f2f960
Last active August 29, 2015 14:26
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@proshanto
proshanto / tmux-cheatsheet.markdown
Last active August 29, 2015 14:26 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
function cdProject() {
projectDir="/var/www/projects"
if [ $# -lt 2 ]; then
echo -e "Argument #1 should be personal or work\n"
echo -e "Argument #2 should be the name of the directory to cd into from personal or work directory."
return 1
fi
if [ $(pwd) != "$projectDir/$1/$2" ]; then

#Laravel 5 Simple ACL manager

Protect your routes with user roles. Simply add a 'role_id' to the User model, install the roles table and seed if you need some example roles to get going.

If the user has a 'Root' role, then they can perform any actions.

Installation

Simply copy the files across into the appropriate directories, and register the middleware in App\Http\Kernel.php

Note: Some of these shortcuts have been remapped for my own convenience (Preferences->Keymap). These are Mac shortcuts, just use the Windows/Linux equivalent of the Cmd/Option/Ctrl/Del keys.

####Search, Go to, Navigation ####

Cmd + P - Search file

Cmd + Shift + O - Search everywhere

(I swapped the above two recently because I use Cmd + P to search for files most of the time).