Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
;; Create and switch to a test buffer. | |
(with-current-buffer (get-buffer-create "*Foo*") | |
;; Ensure it's empty, for testing purposes. | |
(setf (buffer-string) "") | |
;; Insert some test text | |
(insert "hello, world!") | |
;; Now use `shell-command-on-region' to manipulate it. | |
(shell-command-on-region (point-min) (point-max) "tr a-z A-Z" (current-buffer) t)) |
(defun smile () | |
"Smile at you. | |
See https://emacs.stackexchange.com/questions/34271/equivalent-to-the-vim-smile-command" | |
(interactive) | |
(with-help-window "*smile*" | |
(princ " oooo$$$$$$$$$$$$oooo | |
oo$$$$$$$$$$$$$$$$$$$$$$$$o | |
oo$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o o$ $$ o$ | |
o $ oo o$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$o $$ $$ $$o$ |
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
(defun list-prog-modes () | |
"List all programming modes known to this Emacs." | |
(interactive) | |
(with-help-window "*Programming Major Modes*" | |
(mapatoms (lambda (f) | |
(when (provided-mode-derived-p f 'prog-mode) | |
(princ f) | |
(princ "\n")))))) |
import os | |
import re | |
def zsh_to_fish(cmd): | |
return (cmd.replace('&&', '; and ') | |
.replace('||', '; or ')) | |
def is_valid_fish(cmd): |
Python 3.5: ('https://docs.python.org/3.5', None) | |
NumPy [latest]: ('http://docs.scipy.org/doc/numpy/', None) | |
SciPy [latest]: ('http://docs.scipy.org/doc/scipy/reference', None) | |
matplotlib [latest]: ('http://matplotlib.org', None) | |
h5py [latest]: ('http://docs.h5py.org/en/latest/', None) | |
Sphinx [stable]: ('http://www.sphinx-doc.org/en/stable/', None) | |
Django [latest?]: ('http://docs.djangoproject.com/en/dev/', 'https://docs.djangoproject.com/en/dev/_objects/') | |
sarge [latest]: ('http://sarge.readthedocs.io/en/latest/', None) | |
attrs [stable]: ('http://www.attrs.org/en/stable/', None) |
from django.utils import timezone | |
import time | |
# feed = object from DB | |
# doc = parsed feedparser object | |
feed.updated_at = doc.feed.get('updated_parsed', timezone.now()) | |
if isinstance(feed.updated_at, time.struct_time): | |
feed.updated_at = timezone.make_aware( | |
timezone.datetime(*feed.updated_at[:-3]), |
############################################################################## | |
# Attempt go visit the origin hub for the current repo. | |
function gh -d "Visit the repo in its origin hub" | |
# Check that there is some sort of origin. | |
set origin (git config --get remote.origin.url) | |
# If we didn't get anything... | |
if not test "$origin" |
# If we're a dumb terminal give up on using zsh and just go with the default | |
# system shell. This might seem a bit OTT but it really helps with all sorts | |
# of issues with tramp on GNU emacs. | |
if [[ "$TERM" == "dumb" ]] | |
then | |
exec /bin/sh -l | |
fi |
############################################################################## | |
# Self help | |
helper = @grep -Eh "^[a-z]+:.+\# " $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.+\# "}; {printf "$(1)%-20s$(2)%s$(3)\n", $$1, $$2}' | |
.PHONY: help | |
help: # Display this help | |
$(call helper,, ) | |
.PHONY: helpmd | |
helpmd: # Display this help as a markdown table |