Skip to content

Instantly share code, notes, and snippets.

@anabarasan
anabarasan / hangman.py
Created August 10, 2015 12:59
hangman
import random
CATEGORY_LIST = ["Animals", "Countries", "Fruits", "Vegetables"]
CATEGORIES = {
"Animals": ["alligator", "bear", "camel", "cat", "cheetah", "chimpanzee", "cow", "crocodile", "deer", "dog",
"dolphin", "duck", "elephant", "fish", "fox", "frog", "giraffe", "goat", "hamster", "hippopotamus",
"horse", "kangaroo", "lion", "monkey", "octopus", "panda", "pig", "rabbit", "seal", "sheep", "snake",
"spider", "squirrel", "tiger", "wolf", "zebra"],
"Countries": ["Afghanistan", "Albania", "Algeria", "Argentina", "Armenia", "Aruba", "Australia", "Austria",
"Azerbaijan", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Bermuda", "Bhutan",
@anabarasan
anabarasan / Install Cloud9 on local or remote computer, server, or raspberry pi This gist will help you install Cloud9 on your local or remote computer, server, or even your raspberry pi. Many people are having issues at the time of this Gist's creation.
Complete installation process:
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install -y python-software-properties python make build-essential g++ curl libssl-dev apache2-utils git libxml2-dev
sudo apt-get update
sudo apt-get upgrade
cd ~
mkdir git
cd ~/git
@anabarasan
anabarasan / .vimrc
Last active October 17, 2017 06:22
set nocompatible
filetype off
" include vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let vundle manage vundle
Plugin 'gmarik/Vundle.vim' " Vundle
Plugin 'tmhedberg/SimpylFold' " Code Folding
[Boolean]
type: boolean
[Integer]
type: integer
[Real]
type: float
[String]
@anabarasan
anabarasan / install_packages.sh
Last active January 30, 2017 02:10
install Google Chrome, Visual Studio Code and R in ubuntu
# get ubuntu release name
source /etc/lsb-release
# Git
sudo apt-get -y install git
sudo apt-get install -y python-software-properties software-properties-common
# pip
wget -O get-pip.py https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
@anabarasan
anabarasan / Dockerfile
Created March 13, 2018 02:12
c9ide docker file WIP
FROM ubuntu:16.04
MAINTAINER Anbarasan G <[email protected]>
ARG username=admin
ARG password=admin
ARG port=8181
@anabarasan
anabarasan / game_of_life.py
Created August 14, 2018 19:10
Conway's Game of Life
#!/usr/bin/env python3
from argparse import ArgumentParser
from enum import Enum
from sys import argv
from time import sleep
BLOCK = [(5,5), (5,6), (6,5), (6,6)]
BLINKER = [(4,4), (4,5), (4,6)]
@anabarasan
anabarasan / README.md
Created November 26, 2018 05:29 — forked from M1ke/README.md
Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files

Markdown to PDF

Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files

  • Install grip $ pip install grip
  • Install wkhtmltopdf $ sudo apt-get install wkhtmltopdf
@anabarasan
anabarasan / organize
Created March 3, 2020 16:09
organize photos by `year/month/day/file` folder struction based on EXIF data
#!/usr/bin/env python3
from os import listdir
from os.path import dirname, exists, isfile, join
from pathlib import Path
import shutil
import sys
from PIL import ExifTags, Image, UnidentifiedImageError
"""coursera course list sorted by duration"""
#!/usr/bin/env python3
import csv
from http.server import SimpleHTTPRequestHandler
import json
from operator import itemgetter
from socketserver import TCPServer
import threading
from time import sleep