Skip to content

Instantly share code, notes, and snippets.

@amitkot
amitkot / GetProcs.py
Created July 30, 2012 10:44
Mock GetProcs for python course
#!/usr/bin/python
class GetProcs:
d = [(i, i**2, i**3) for i in range(10)]
i = 0
@classmethod
def GetFirstProc(cls):
print 'GetFirstProc - {} (i={}, d={})'.format(cls.d[cls.i], cls.i, cls.d)
@amitkot
amitkot / bank_accounts_spec.md
Last active December 12, 2015 09:59
Bank Accounts Spec

Bank account Management App

Screens

Accounts List

  • Show a list of accounts
  • Allow adding a new account
  • Edit Account details

Create Account / Edit Account Info

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@amitkot
amitkot / .vimrc
Created August 19, 2013 09:50
.vimrc file to use on remote servers
set modeline
set autochdir
set hls
set incsearch
set mouse=a
@amitkot
amitkot / .tmux.conf
Created August 19, 2013 09:53
tmux config file for remote servers
set-option -g default-shell /bin/bash
set -g status-utf8 on
set -g status-keys vi
set -g status-interval 1
set -g prefix `
bind ` send-key `
""" Creating localization directories in an Andorid project
The script creates the required directories and copies the default strings.xml
file to each of them.
Those xml files can later be editted.
"""
from path import path
VALUES = "values"
@amitkot
amitkot / coolscript.py
Created September 17, 2014 10:47
Script for Modules and Packages lab - Python Course 2014
from optparse import OptionParser
def main():
parser = OptionParser()
parser.add_option("-f", "--file", dest="filename",
help="write report to FILE", metavar="FILE")
# ADD YOUR OPTION HERE:
(options, args) = parser.parse_args()
pm list packages -f
@amitkot
amitkot / gist:c775a6b64a162b6e6b39
Last active May 15, 2016 20:53
Marquee TextView Android ticker
<TextView
android:id="@+id/stock_ticker"
android:layout_alignParentBottom="true"
android:textSize="15sp"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:ellipsize="marquee"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
@amitkot
amitkot / name_remove_prefix.py
Last active August 29, 2015 14:11
A Script for changing filenames to remove a prefix. This script was used to prepare a directory containing many files in sub directories, for import using beets (https://github.com/sampsyo/beets).
#!/usr/bin/env python3
""" A Script for changing filenames to remove a prefix
This script was used to prepare a directory containing many files in sub
directories, for import using beets (https://github.com/sampsyo/beets).
"""
import fnmatch
import os