Skip to content

Instantly share code, notes, and snippets.

View bkawan's full-sized avatar
🎯
Focusing

Bikesh Kawan bkawan

🎯
Focusing
View GitHub Profile

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@bkawan
bkawan / sortDates.js
Created April 9, 2018 16:46
Sorting date with javascript
let unsortedDates =
['2018-01-26',
'2018-01-30',
'2018-02-13',
'2018-02-20',
'2018-02-27',
'2018-03-01',
'2018-03-17',
'2018-03-21',
'2018-03-06',
@bkawan
bkawan / custom-template-filters
Created February 11, 2018 06:16
Django multiple filter at once.
https://micropyramid.com/blog/django-custom-template-tags-and-filters/
@register.filter(name='one_more')
def another_filter(value_1, value_2):
return value_1.upper(), value_2.lower()
@register.filter()
def custom_filter(another_filter_value, value_3):
value_1, value_2 = another_filter_value
@bkawan
bkawan / python-env-django-setup.md
Last active February 2, 2018 15:17
Python Environment Setup and Django for Ubuntu

Python Environment Setup and Django for Ubuntu/Mac OSX/ Windows

You can install and setup environment for Windows/ Mac OSX also. If you find it difficult, leave me a message.

For Windows please follow this link
 https://www.codingforentrepreneurs.com/blog/install-python-django-on-windows/

 https://docs.djangoproject.com/en/2.0/howto/windows/
For Mac OSX please follow the link below
@bkawan
bkawan / gunicorn_start.bash
Created May 27, 2017 06:18 — forked from postrational/gunicorn_start.bash
Example of how to set up Django on Nginx with Gunicorn and supervisordhttp://michal.karzynski.pl/blog/2013/06/09/django-nginx-gunicorn-virtualenv-supervisor/
#!/bin/bash
NAME="hello_app" # Name of the application
DJANGODIR=/webapps/hello_django/hello # Django project directory
SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket
USER=hello # the user to run as
GROUP=webapps # the group to run as
NUM_WORKERS=3 # how many worker processes should Gunicorn spawn
DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use
DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name
@bkawan
bkawan / jupyter_shortcuts.md
Created April 24, 2017 04:41 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command
@bkawan
bkawan / iterm2.md
Created December 28, 2016 14:54
iterm2 cheatsheet

Tabs and Windows

Function Shortcut
Previous Tab + Left Arrow
Next Tab + Right Arrow
Go to Tab + Number
Go to Window + Option + Number
Go to Split Pane by Direction + Option + Arrow
Go to Split Pane by Order of Use + ] , + [