Skip to content

Instantly share code, notes, and snippets.

View junkw's full-sized avatar
🤔

Jumpei KAWAMI junkw

🤔
View GitHub Profile
@textarcana
textarcana / git-log2json.sh
Last active October 23, 2024 19:19
Convert Git logs to JSON. The first script (git-log2json.sh) is all you need, the other two files contain only optional bonus features 😀THIS GIST NOW HAS A FULL GIT REPO: https://github.com/context-driven-testing-toolkit/git-log2json
#!/usr/bin/env bash
# Use this one-liner to produce a JSON literal from the Git log:
git log \
--pretty=format:'{%n "commit": "%H",%n "author": "%aN <%aE>",%n "date": "%ad",%n "message": "%f"%n},' \
$@ | \
perl -pe 'BEGIN{print "["}; END{print "]\n"}' | \
perl -pe 's/},]/}]/'
@kiwanami
kiwanami / ruby-mode-imenu-customize.el
Created August 8, 2012 02:49
ruby-mode-imenu-customize.el
;; for Emacs 23.4 ruby-mode
(eval-after-load "ruby-mode"
'(progn
(defun ruby-imenu-create-index-in-block (prefix beg end)
(let ((index-alist '()) (case-fold-search nil)
name next pos decl sing)
(goto-char beg)
(while (re-search-forward "^\\s *\\(\\(class\\s +\\|\\(class\\s *<<\\s *\\)\\|module\\s +\\)\\([^\(<\n ]+\\)\\|\\(def\\|alias\\|get\\|post\\|describe\\|context\\)\\s +\\([^\(\n]+\\)\\)" end t)
(setq sing (match-beginning 3))
@yoshinari-nomura
yoshinari-nomura / gist:3465571
Created August 25, 2012 13:20
Font setup for Cocoa Emacs24
(when (and (>= emacs-major-version 24)
(eq window-system 'ns))
;; フォントセットを作る
(let* ((fontset-name "myfonts") ; フォントセットの名前
(size 14) ; ASCIIフォントのサイズ [9/10/12/14/15/17/19/20/...]
(asciifont "Menlo") ; ASCIIフォント
(jpfont "Hiragino Maru Gothic ProN") ; 日本語フォント
(font (format "%s-%d:weight=normal:slant=normal" asciifont size))
(fontspec (font-spec :family asciifont))
(jp-fontspec (font-spec :family jpfont))
@textarcana
textarcana / centos-install-syntax-highlighting-in-less.sh
Last active May 1, 2023 01:01
2020 update: just use bat(1) instead!!!! bat has git integration and also can show invisible characters! OLD STUFF: How to enable syntax-highlighting in less. Use `less -N` (or type -N while in less) to enable line numbers. Based on the procedure described in http://superuser.com/questions/71588
# Enable syntax-highlighting in less.
# Last tested on CentOS 6.3.
#
# First, add these two lines to ~/.bashrc
# export LESSOPEN="| /usr/bin/src-hilite-lesspipe.sh %s"
# export LESS=" -R "
sudo yum -y install boost boost-devel ctags
wget http://springdale.math.ias.edu/data/puias/unsupported/6/x86_64/source-highlight-3.1.6-3.puias6.x86_64.rpm
@dergachev
dergachev / GIF-Screencast-OSX.md
Last active November 5, 2024 18:44
OS X Screencast to animated GIF

OS X Screencast to animated GIF

This gist shows how to create a GIF screencast using only free OS X tools: QuickTime, ffmpeg, and gifsicle.

Screencapture GIF

Instructions

To capture the video (filesize: 19MB), using the free "QuickTime Player" application:

@bobbygrace
bobbygrace / trello-css-guide.md
Last active November 3, 2024 14:56
Trello CSS Guide

Hello, visitors! If you want an updated version of this styleguide in repo form with tons of real-life examples… check out Trellisheets! https://github.com/trello/trellisheets


Trello CSS Guide

“I perfectly understand our CSS. I never have any issues with cascading rules. I never have to use !important or inline styles. Even though somebody else wrote this bit of CSS, I know exactly how it works and how to extend it. Fixes are easy! I have a hard time breaking our CSS. I know exactly where to put new CSS. We use all of our CSS and it’s pretty small overall. When I delete a template, I know the exact corresponding CSS file and I can delete it all at once. Nothing gets left behind.”

You often hear updog saying stuff like this. Who’s updog? Not much, who is up with you?

@daviderestivo
daviderestivo / eshell-prompt.el
Last active July 21, 2019 20:38
Eshell prompt
(defun galactic-emacs-eshell-prompt ()
"Customize eshell prompt.
This function requires `all-the-icons' package to be installed
(https://github.com/domtronn/all-the-icons.el)."
(if (display-graphic-p)
(setq galactic-emacs-header-bg "#282C34")
;; The background used when Emacs runs in a terminal
(setq galactic-emacs-header-bg "black"))
;; In order to set the eshell prompt correctly we need to
@agumonkey
agumonkey / defcmd.el
Last active November 7, 2017 14:59
DEFCMD.EL : no more interactive string specs
;;; DEFCMD.EL : no more interactive string specs
(setq lexical-binding t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MODULE
(defun interactive-arg-map (l)
(if (evenp (length l))
(let* ((ps (-partition 2 l))
(params (mapcar #'car ps))
(defun copy-current-line-position-to-clipboard (p)
"Copy current line in file to clipboard as '</path/to/file>:<line-number>'"
(interactive "sAbsolute path y/n?: ")
(let ((path-with-line-number) (file-name (buffer-file-name)))
(when (and (not (string= p "y")) (projectile-project-root))
(setq file-name (file-relative-name buffer-file-name (projectile-project-root)))
)
(setq path-with-line-number (concat file-name ":" (number-to-string (line-number-at-pos))))
(x-select-text path-with-line-number)
(message (concat path-with-line-number " copied to clipboard"))))