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
@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
@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 / 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 / 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 / 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:

# -*- 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():
# 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
@proshanto
proshanto / gist:0a9ca63f96fdac16e18c076cf87b9769
Created April 17, 2017 22:24 — forked from Atem18/gist:4696071
Tutorial to seting up a django website in production.

Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@proshanto
proshanto / SchemaSpy-HOWTO.md
Created January 24, 2018 12:20 — forked from dpapathanasiou/SchemaSpy-HOWTO.md
How to use SchemaSpy to generate the db schema diagram for a PostgreSQL database

SchemaSpy is a neat tool to produce visual diagrams for most relational databases.

Here's how to use it to generate schema relationship diagrams for PostgreSQL databases:

  1. Download the jar file from here (the current version is schemaSpy_5.0.0.jar)

  2. Get the PostgreSQL JDBC driver (either the JDBC3 or JDBC4 jar file is fine)

  3. Run the command against an existing database. For most databases, the schema (-s option) we are interested in is the public one:

@proshanto
proshanto / secretkey.py
Created January 24, 2018 20:27 — forked from geoffalday/secretkey.py
How to generate a secret key with Python
# How to generate a secret key with Python
# via http://flask.pocoo.org/docs/quickstart/
import os
os.urandom(24)