Skip to content

Instantly share code, notes, and snippets.

View gaiar's full-sized avatar

Gaiar Baimuratov gaiar

View GitHub Profile
/**
* @param $app
* @return int:
* -4: Error
* -3: Googlebot
* -2: Found locally, not a VPN
* -1: Looked up, not a VPN
* 1: Looked up, VPN
* 2: Found locally, VPN
*/
@gaiar
gaiar / tmux-cheatsheet.markdown
Created June 26, 2017 06:08 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@gaiar
gaiar / main.py
Last active September 9, 2015 07:14 — forked from leandrotoledo/main.py
Webhook using self-signed certificate and Flask (with python-telegram-bot library)
#!/usr/bin/env python
'''Using Webhook and self-signed certificate'''
# This file is an annotated example of a webhook based bot for
# telegram. It does not do anything useful, other than provide a quick
# template for whipping up a testbot. Basically, fill in the CONFIG
# section and run it.
# Dependencies (use pip to install them):
# - python-telegram-bot: https://github.com/leandrotoledo/python-telegram-bot
@gaiar
gaiar / pycon-views.py
Last active August 26, 2015 11:37 — forked from miguelgrinberg/pycon-views.py
Generate statistics about PyCon 2014 videos
import argparse
import re
from multiprocessing.pool import ThreadPool as Pool
import requests
import bs4
root_url = 'http://pyvideo.org'
index_url = root_url + '/category/50/pycon-us-2014'