Skip to content

Instantly share code, notes, and snippets.

View psachin's full-sized avatar
🚀
Evolving

Sachin psachin

🚀
Evolving
View GitHub Profile
@psachin
psachin / .bashrc
Created January 18, 2012 06:13 — forked from ralfebert/.bashrc
git settings
# Prompt
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\033[31;38m\]\u@\h\[\033[00m\]:\[\033[31;38m\]\w\[\033[1;31m\]\$(parse_git_branch)\[\033[00m\] "
# Editor
export GIT_EDITOR='nano -Y patch'
@psachin
psachin / magit.el
Last active December 22, 2015 00:09
Custom commit.template for magit-1.2.0
;; Commit template location.
;; It can also be ~/.gitmessage.txt
(defcustom commit-template "./.git/COMMIT_EDITMSG"
"Path to custom message template file. If nil, no custom
message will be inserted to *magit-edit-log* buffer. The path can
be relative as well as absolute."
:group 'magit
:type 'string)
;; and modify this function accordingly
;;;
;;; Recursively list files in a given directory
;;;
;;; Author: daniel m german dmg at uvic dot ca
;;; Copyright: daniel m german
;;; License: Same as Emacs
;;;
(defun directory-files-recursive (directory match maxdepth ignore)
"List files in DIRECTORY and in its sub-directories.
Return files that match the regular expression MATCH but ignore
# Source: https://gist.github.com/4702275
#
# All-purpose gist tool for Pythonista.
#
# When run directly, this script sets up four other scripts that call various
# functions within this file. Each of these sub-scripts are meant for use as
# action menu items. They are:
#
# Set Gist ID.py - Set the gist id that the current file should be
# associated with.
@psachin
psachin / example.el
Last active December 29, 2015 06:49
Example gist to test gist validation for haqiba.org
;; Example
(defun example()
"Example function defun."
(message "Put something more useful here."))
@psachin
psachin / python-pep8.el
Last active December 29, 2015 18:19 — forked from ieure/python-pep8.el
;;; python-pep8.el --- minor mode for running `pep8'
;; Copyright (c) 2009, 2010 Ian Eure <ian.eure@gmail.com>
;; Author: Ian Eure <ian.eure@gmail.com>
;; Keywords: languages python
;; Last edit: 2010-02-12
;; Version: 1.01
@psachin
psachin / prompt.sh
Last active February 16, 2016 05:38
My bash Prompt
# `bashPrompt.sh` is located at: https://raw.githubusercontent.com/psachin/bash_scripts/master/bashPrompt.sh
source bashPrompt.sh
PS1='\n{\[\033[35m\]$(current_date)\[\e[0m\]}\n[\[\e[01;30m\]\w\[\e[0m\]]-(\[\033[35m\]$(list_dirs) dirs, $(list_files) files\[\e[0m\])\n\[\e[0;34m\]\u\[\e[0m\]\[\e[0;35m\]@\[\e[0m\]\[\e[0;31m\]\h\[\e[0m\]\[\e[0;32m\]:\[\e[0m\]\[\e[0;32m\]$(parse_git_branch)$(which_user)\[\e[0m\] '
;;;
;;; Recursively list files in a given directory
;;;
;;; Author: daniel m german dmg at uvic dot ca
;;; Copyright: daniel m german
;;; License: Same as Emacs
;;;
(defun directory-files-recursive (directory match maxdepth ignore)
"List files in DIRECTORY and in its sub-directories.
Return files that match the regular expression MATCH but ignore
#/usr/bin/env python
# ex1.py
@g
def f():
print("xyz")
# is equivalent to
def f():
#!/usr/bin/env python
import wx
class demo(wx.Frame):
def __init__(self, parent,id):
wx.Frame.__init__(self,parent,id,'Frame title here', size=(300,200))
if __name__=='__main__':
app=wx.PySimpleApp()