Skip to content

Instantly share code, notes, and snippets.

Avatar
🚀
Evolving

Sachin psachin

🚀
Evolving
View GitHub Profile
@psachin
psachin / .bashrc
Created Jan 18, 2012 — forked from ralfebert/.bashrc
git settings
View .bashrc
# 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 Dec 22, 2015
Custom commit.template for magit-1.2.0
View magit.el
;; 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
View directory-files-recursive.el
;;;
;;; 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
View gistcheck.py
# 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 Dec 29, 2015
Example gist to test gist validation for haqiba.org
View example.el
;; Example
(defun example()
"Example function defun."
(message "Put something more useful here."))
View 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 Feb 16, 2016
My bash Prompt
View prompt.sh
# `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\] '
View directory-files-recursive.el
;;;
;;; 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
View decorate.py
#/usr/bin/env python
# ex1.py
@g
def f():
print("xyz")
# is equivalent to
def f():
View oscad_test.py
#!/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()