Skip to content

Instantly share code, notes, and snippets.

View bkawan's full-sized avatar
🎯
Focusing

Bikesh Kawan bkawan

🎯
Focusing
View GitHub Profile
@CleverProgrammer
CleverProgrammer / Procfile
Last active July 28, 2019 05:19
How to Host a Django App on Heroku
web: gunicorn project_name.wsgi
@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
@umidjons
umidjons / youtube-dl-download-audio-only-on-best-quality.md
Last active March 9, 2024 07:54
Download Audio from YouTube with youtube-dl

Download Audio from YouTube

-i - ignore errors

-c - continue

-t - use video title as file name

--extract-audio - extract audio track

@dvdbng
dvdbng / vim-heroku.sh
Last active April 22, 2024 22:42
Run vim in heroku updated 2017
mkdir ~/vim
cd ~/vim
# Staically linked vim version compiled from https://github.com/ericpruitt/static-vim
# Compiled on Jul 20 2017
curl 'https://s3.amazonaws.com/bengoa/vim-static.tar.gz' | tar -xz
export VIMRUNTIME="$HOME/vim/runtime"
export PATH="$HOME/vim:$PATH"
cd -
@scrapehero
scrapehero / tripadvisor_scraper.py
Last active January 24, 2021 15:06
Python Script to scrape Tripadvisor.com for Hotels in a locality. Code Written as part of https://www.scrapehero.com/how-to-scrape-tripadvisor/
#!/usr/bin/env python
from datetime import datetime
from time import time
from lxml import html,etree
import requests,re
import os,sys
import unicodecsv as csv
import argparse
def parse(locality,checkin_date,checkout_date,sort):
@scrapehero
scrapehero / tripadvisor_scraper_hotel.py
Last active December 17, 2018 10:09
Python 2.7 code to extract data from tripadvisor hotel
# -*- coding: utf-8 -*-
from lxml import html
import requests
from collections import OrderedDict
import json
import argparse
import re
import sys
# Adjust MAX_RETRY according to the blocking from tripadvisor
MAX_RETRY = 10
sudo apt-get update
sudo apt-get install python3-pip python3-dev libpq-dev postgresql postgresql-contrib nginx
sudo -u postgres psql
- paste this code in postgres console:
CREATE DATABASE django_project;
CREATE USER username WITH PASSWORD 'pass1234';
ALTER ROLE username SET client_encoding TO 'utf8';
ALTER ROLE username SET default_transaction_isolation TO 'read committed';
@mguezuraga
mguezuraga / AESCipher.py
Last active February 24, 2020 23:16 — forked from swinton/AESCipher.py
Encrypt & Decrypt using PyCrypto AES 256From http://stackoverflow.com/a/12525165/119849
#!/usr/bin/env python
import base64
from Crypto import Random
from Crypto.Cipher import AES
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-s[-1]]
@languanghao
languanghao / left-bar.vue
Created December 22, 2016 06:56
element ui menu with vue-router
<template>
<el-menu :router="true" :default-active="activeLink">
<template v-for="rule in $router.options.routes">
<el-submenu v-if="rule.children && rule.children.length > 0"
:index="rule.path"
>
<template slot="title"><i :class="rule.icon"></i>{{ rule.title }}</template>
<el-menu-item v-for="child in rule.children" :index="rule.path + '/' + child.path">{{ child.title }}</el-menu-item>
</el-submenu>
<el-menu-item v-else
@nrollr
nrollr / MySQL_macOS_Sierra.md
Last active January 31, 2024 14:45
Install MySQL on Sierra using Homebrew

Install MySQL on macOS Sierra

This procedure explains how to install MySQL using Homebrew on macOS Sierra 10.12

Install Homebrew

  • Installing Homebrew is effortless, open Terminal and enter :
    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  • Note: Homebrew will download and install Command Line Tools for Xcode 8.0 as part of the installation process.

Install MySQL

At this time of writing, Homebrew has MySQL version 5.7.15 as default formulae in its main repository :