Skip to content

Instantly share code, notes, and snippets.

@jayachandp
jayachandp / .bash_prompt.sh
Created November 16, 2017 14:26 — forked from miki725/.bash_prompt.sh
Custom bash prompt which displays: (virtualenv) user:/path (git-branch)
#!/bin/bash
#
# DESCRIPTION:
#
# Set the bash prompt according to:
# * the active virtualenv
# * the branch of the current git/mercurial repository
# * the return value of the previous command
# * the fact you just came from Windows and are used to having newlines in
# your prompts.

Sublime Text 2 - Useful Shortcuts

Tested in Mac OS X: super == command

Open/Goto


  • super+t: go to file
  • super+ctrl+p: go to project
  • super+r: go to methods
@jayachandp
jayachandp / google_map
Created March 27, 2014 17:59
Google maps plotting in html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.1.min.js"></script>
</head>
<body>
<div id="map" style="width: 500px; height: 400px;"></div>
@jayachandp
jayachandp / chat.py
Created March 17, 2014 17:10 — forked from vyshuks/chat.py
from flask import Flask, request
chat = Flask(__name__)
html = """
<html><head><style>
#mychat{width:100%; font-size: 15px; padding: 10px; border: 1px solid #111111;}
</style></head><body>
<input id="mychat" placeholder="Type message and press enter"/>
<div id="chat"></div>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
@jayachandp
jayachandp / gist:9508868
Created March 12, 2014 15:08
pip freeze
Django==1.6.2
Pillow==2.3.0
PyFlot==0.2
South==0.8.4
boto==2.17.0
braintree==2.28.0
django-allauth==0.16.0
django-autofixture==0.6.3
django-autoslug==1.7.2
django-bootstrap-form==3.1
@jayachandp
jayachandp / gist:9508698
Created March 12, 2014 15:00
Error while syncdb
Traceback (most recent call last):
File "manage.py", line 24, in <module>
execute_from_command_line(sys.argv)
File "/Users/jay/Envs/scankartenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Users/jay/Envs/scankartenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/jay/Envs/scankartenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 272, in fetch_command
klass = load_command_class(app_name, subcommand)
File "/Users/jay/Envs/scankartenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 75, in load_command_class
@jayachandp
jayachandp / gist:9507824
Created March 12, 2014 14:16
Error after installing psycopg2 with setting CFLAGS and CPPFLAGS with -Qunused-arguments
Traceback (most recent call last):
File "manage.py", line 24, in <module>
execute_from_command_line(sys.argv)
File "/Users/jay/Envs/scankartenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Users/jay/Envs/scankartenv/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/jay/Envs/scankartenv/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/jay/Envs/scankartenv/lib/python2.7/site-packages/django/core/management/base.py", line 280, in execute