Skip to content

Instantly share code, notes, and snippets.

View ChillarAnand's full-sized avatar

Chillar Anand ChillarAnand

View GitHub Profile
;;; auto-remove.el --- Auto remove unused functions in python
;;; Commentary:
;; Uses external tool autoflake to remove unused imports from a Python file.
;;; Code:
(defcustom python-autoflake-path (executable-find "autoflake")
"Autoflake executable path.
@ChillarAnand
ChillarAnand / Pear_App_Django.ipynb
Last active August 29, 2015 14:05
Pear_App_Django.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ChillarAnand
ChillarAnand / unzip_files.py
Created August 19, 2014 13:02
unzip_files.py
def unzip_files(path):
"""
Unzip the files in the given location & remove zip files.
"""
zip_files = [files for files in listdir(path)]
with cd(path):
for zip_file in zip_files:
commands = [["7z", "e", zip_file], ["rm", zip_file]]
for command in commands:
call(command, stdout=open(devnull, 'wb'))
HELP
=======================================================
C-h a command-apropos What commands work like this...?
apropos What functions and variables work like this...?
C-h c describe-key-briefly What command does this key sequence do?
C-h b describe-bindings What are the key bindings for this buffer?
C-h k describe-key What command does this sequence do, and tell me about it.
C-h l view-lossage What are the last 100 characters typed?
C-h w where-is What is the key binding for this?
C-h f describe-function What does this function do?
@ChillarAnand
ChillarAnand / gist:a1eae6feb37c6064444c
Created September 4, 2014 07:10
Celery-Woker-Log
[2014-09-04 07:09:40,777: DEBUG/MainProcess] pidbox received method ping() [reply_to:{u'routing_key': u'3eee52f8-7903-3253-bed7-41a34ae1347d', u'exchange': u'reply.celery.pidbox'} ticket:3693bbdb-933e-431f-9b7e-0e1752ae0abb]
[2014-09-04 07:09:41,360: DEBUG/MainProcess] pidbox received method enable_events() [reply_to:None ticket:None]
[2014-09-04 07:09:41,787: DEBUG/MainProcess] pidbox received method active_queues() [reply_to:{u'routing_key': u'3eee52f8-7903-3253-bed7-41a34ae1347d', u'exchange': u'reply.celery.pidbox'} ticket:0cc05c05-c65d-416f-ab15-37625db3f4d5]
[2014-09-04 07:09:42,802: DEBUG/MainProcess] pidbox received method dump_conf(with_defaults=False) [reply_to:{u'routing_key': u'3eee52f8-7903-3253-bed7-41a34ae1347d', u'exchange': u'reply.celery.pidbox'} ticket:fdff4684-4006-4147-9eb3-6174b3f402f1]
[2014-09-04 07:09:43,484: DEBUG/MainProcess] pidbox received method shutdown() [reply_to:None ticket:None]
[2014-09-04 07:09:43,484: WARNING/MainProcess] Got shutdown from remote
[2014-09-04 07:09:43,485:
@ChillarAnand
ChillarAnand / gist:77be59df924dd50ac9ce
Last active August 29, 2015 14:06
Celery Countdown
In [95]: add.s(1,1)
Out[95]: apps.processing.tasks.add(1, 1)
In [96]: add.s(1,1).set(countdown=10)
Out[96]: apps.processing.tasks.add(1, 1)
#no countdown here
In [97]: add.s((1,1), countdown=10)
Out[97]: apps.processing.tasks.add((1, 1), countdown=10)
@ChillarAnand
ChillarAnand / fastqc_data.txt
Last active August 29, 2015 14:07
fastqc_data.txt
##FastQC 0.10.1
>>Basic Statistics pass
#Measure Value
Filename sample1.fastq
File type Conventional base calls
Encoding Sanger / Illumina 1.9
Total Sequences 1571332
Filtered Sequences 0
Sequence length 29
%GC 53
wget http://modwsgi.googlecode.com/files/mod_wsgi-3.4.tar.gz
tar xvfz mod_wsgi-3.4.tar.gz
cd mod_wsgi-3.4
./configure
make
make install
echo "LoadModule wsgi_module /usr/lib/apache2/modules/mod_wsgi.so" > /etc/apache2/mods-available/wsgi.load
a2enmod wsgi
a2dissite default
@ChillarAnand
ChillarAnand / sample django wsgi apache config
Last active August 29, 2015 14:08
sample django wsgi apache config
<VirtualHost *:80>
ServerName www.example.com
ServerAlias example.com
ServerAdmin webmaster@example.com
WSGIPythonPath /path/to/mysite.com:/path/to/your/venv/lib/python2.X/site-packages
WSGIScriptAlias / /usr/local/www/wsgi-scripts/myapp.wsgi
DocumentRoot /usr/local/www/documents
@ChillarAnand
ChillarAnand / py & py3 wsgi conflicts
Created November 4, 2014 14:02
py & py3 wsgi conflicts
From your traceback, flask_bootstrap is installed at /usr/local/lib/python3.4/dist-packages in your server.
So you have to add this sys.path[0]
Lets do a simple test.
Create a test2.py and run it with `python test.py`
import sys
print(sys.path)