This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
;;; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Example | |
(defun example() | |
"Example function defun." | |
(message "Put something more useful here.")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# `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\] ' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;;; | |
;;; 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/usr/bin/env python | |
# ex1.py | |
@g | |
def f(): | |
print("xyz") | |
# is equivalent to | |
def f(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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() |
OlderNewer