Skip to content

Instantly share code, notes, and snippets.

Chirag Vora chirag-v

Block or report user

Report or block chirag-v

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Magic_commands_ipython
Define an alias for a system command.
%alias_magic [-l] [-c] name target
Make functions callable without having to type parentheses.
Make magic functions callable without having to type the initial %.
Manage IPython's bookmark system.
package com.myurl.myapp;
import android.os.Bundle;
import android.annotation.SuppressLint;
chirag-v /
Created Feb 28, 2013
list comprehension method to get even numbers from a range.
def even(x):
return x % 2 == 0
[num for num in range(10) if even(num)]
chirag-v /
Last active Dec 14, 2015
How to filter( ) even numbers from a given range ( ) of numbers.
def even(x):
return x % 2 == 0
list(__builtin__.filter(even, range(10)))
chirag-v /
Last active Dec 14, 2015
isnan function in python
import math as m
m.isnan(x) # True
#Show how to make and save a simple line plot with labels, title and grid
#modified from matplotlib official tutorial @
#Run directly on iPython shell
import numpy
import pylab
import shutil
shutil.copy('/home/user/', '/home/user/backup/')
## if you want to preserve the meta-data of acetylene.txt
## then you should use shutil.copy2()
chirag-v / .emacs.el
Last active Dec 12, 2015
.emacs file
View .emacs.el
;; Convert "yes or no" prompts to "y or n" instead
(fset 'yes-or-no-p 'y-or-n-p)
;; [Home] & [End] key will take you to beginning & end of line
(global-set-key [home] 'beginning-of-line)
(global-set-key [end] 'end-of-line)
;; displays the time in the status bar
chirag-v / elisp-delete.el
Last active Dec 12, 2015
elisp [delete] key
View elisp-delete.el
;; Use [Delete] key to delete selected characters
(global-set-key [delete] 'delete-char)
chirag-v / Z-matrix
Created Feb 13, 2013
Z-matrix of acetaldehyde created using avogadro
View Z-matrix
0 1
H 1 1.08515
C 1 1.49318 2 120.10198
O 1 1.22026 2 119.76319 3 180.02562
H 3 1.11007 1 109.81648 2 359.97438
H 3 1.11015 1 109.75404 2 240.10815
H 3 1.11015 1 109.75404 2 119.89178
You can’t perform that action at this time.