Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
barseghyanartur / pyaudio-ubuntu-install.md
Created November 5, 2018 22:43 — forked from diegopacheco/pyaudio-ubuntu-install.md
How to Install pyaudio ubuntu 16.04 LTS?
sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
sudo apt-get install ffmpeg libav-tools
sudo pip install pyaudio
@barseghyanartur
barseghyanartur / install.sh
Created September 29, 2018 22:20 — forked from ziadoz/install.sh
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# http://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# http://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# http://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# http://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS chromedriver.storage.googleapis.com/LATEST_RELEASE`
@barseghyanartur
barseghyanartur / git-tag-delete-local-and-remote.sh
Created July 23, 2018 11:43 — forked from mobilemind/git-tag-delete-local-and-remote.sh
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName
@barseghyanartur
barseghyanartur / fobi_states.txt
Created March 27, 2018 08:32 — forked from jawinn/fobi_states.txt
Django FOBI - List of US States and Territories for Select Menu
AK, Alaska
AL, Alabama
AR, Arkansas
AS, American Samoa
AZ, Arizona
CA, California
CO, Colorado
CT, Connecticut
DC, District of Columbia
DE, Delaware
@barseghyanartur
barseghyanartur / gist:7a628f8426485ae08dfc52e8fad483c2
Created March 20, 2018 13:45 — forked from douglasmiranda/gist:5408278
Leading zeros in django templates
{{ variable|stringformat:"02d" }}
@barseghyanartur
barseghyanartur / conditional_dependency.py
Last active February 7, 2018 09:49
This is an example showing how to do conditional dependency loading in Python. It also demonstrates that extras_requires entries take precedence over the sub-dependency entries belonging to packages in the install_requires list. The test shows this by intentionally installing a version of Werkzeug that is too old for the version of Flask. Attemp…
# -*- coding: utf-8 -*-
### Test by running: pip install -e .[subs]
import sys
from setuptools import setup
major, minor, micro = sys.version_info[:3]
install_requires26 = [
@barseghyanartur
barseghyanartur / pyqt_opencv.py
Created November 19, 2017 00:05 — forked from saghul/pyqt_opencv.py
Render OpenCV video on a PyQt widget
# coding=utf8
# Copyright (C) 2011 Saúl Ibarra Corretgé <saghul@gmail.com>
#
# Some inspiration taken from: http://www.morethantechnical.com/2009/03/05/qt-opencv-combined-for-face-detecting-qwidgets/
import cv
import sys

Install dlib and face_recognition on a Raspberry Pi

Instructions tested with a Raspberry Pi 2 with an 8GB memory card. Probably also works fine on a Raspberry Pi 3.

Steps

Download the latest Raspbian Jessie Light image. Earlier versions of Raspbian won't work.

Write it to a memory card using Etcher, put the memory card in the RPi and boot it up.

@barseghyanartur
barseghyanartur / nginx.conf
Created September 25, 2017 13:55 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@barseghyanartur
barseghyanartur / snake.py
Created September 19, 2017 22:54 — forked from sanchitgangwar/snake.py
Snakes Game using Python
# SNAKES GAME
# Use ARROW KEYS to play, SPACE BAR for pausing/resuming and Esc Key for exiting
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
curses.initscr()
win = curses.newwin(20, 60, 0, 0)