Skip to content

Instantly share code, notes, and snippets.

{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@fgeller
fgeller / prepare-commit-msg
Created March 21, 2017 01:20
prefixes commit message with path of changed files. useful in mono-repo setup
#!/bin/sh
prefixes=$(git diff --cached --name-only | while read f ; do echo "${f%/*}" ; done | sort | uniq)
prefixes_count=$(echo $prefixes | wc -l)
if [ "$prefixes_count" -eq "1" ]; then
sed -i "1s;^;$prefixes: \n;" "$1"
fi
@fgeller
fgeller / gist:6135dd53788fb0d67f2d0b178b7feea1
Last active January 28, 2017 21:37
return / control remapping with forked karabiner elements
Via https://github.com/tekezo/Karabiner-Elements/pull/247#issuecomment-265033986
Download & install https://github.com/wwwjfy/Karabiner-Elements/releases/tag/0.90.83
To remap caps lock and return to control and return when pressed alone
Edit ~/.config/karabiner/karabiner.json to include
{
"global": {
@fgeller
fgeller / Tomorrow-iv.terminal
Last active October 24, 2015 09:06
Small tweaks to Tomorrow theme for Terminal.app from https://github.com/lysyi3m/osx-terminal-themes
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw
IDAAEAKAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj
dF8QD05TS2V5ZWRBcmNoaXZlctEXGFRyb290gAEIERojLTI3O0FITltiaWttcn2GjpGa
#!/usr/bin/env bash
# ~/.osx — https://mths.be/osx
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until `.osx` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
@fgeller
fgeller / Tomorrow-iv.itermcolors
Last active October 24, 2015 08:49
Small tweaks to default foreground/background/cursor colors for Tomorrow theme from http://iterm2colorschemes.com/
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Ansi 0 Color</key>
<dict>
<key>Blue Component</key>
<real>0.0</real>
<key>Green Component</key>
<real>0.0</real>
@fgeller
fgeller / record.el
Created December 7, 2014 06:46
Show key presses via dribble
(defun start-recording ()
(interactive)
(setq auto-revert-interval 0.5)
(auto-revert-set-timer)
(when (file-exists-p "keys.log") (delete-file "keys.log"))
(delete-other-windows)
(split-window-vertically (- (window-height) 5))
(other-window 1)
(nlinum-mode -1)
(find-file (expand-file-name "./keys.log"))
@fgeller
fgeller / .ctags.conf
Last active October 23, 2016 23:53
ctags regexs for scala
--langdef=Scala
--langmap=Scala:.scala
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*class[ \t]+([a-zA-Z0-9_]+)/\4/c,classes/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*object[ \t]+([a-zA-Z0-9_]+)/\4/c,objects/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*case class[ \t]+([a-zA-Z0-9_]+)/\4/c,classes/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*case object[ \t]+([a-zA-Z0-9_]+)/\4/c,objects/
--regex-scala=/^[ \t]*((abstract|final|sealed|implicit|lazy)[ \t]*)*(private|protected)?[ \t]*trait[ \t]+([a-zA-Z0-9_]+)/\4/t,traits/
--regex-scala=/^[ \t]*type[ \t]+([a-zA-Z0-9_]+)/\1/T,types/
--regex-scala=/^[ \t]*(override)?[ \t]*(private|protected)?[ \t]*((abstract|final|sealed|implicit|lazy)?[ \t]*)def[ \t]+([a-zA-Z0-9_]+)/\5/m,methods/
@fgeller
fgeller / emacs-mac.rb
Created July 20, 2013 08:32
railwaycat's emacs-mac formula with some tweaks.
require 'formula'
class EmacsMac < Formula
homepage 'http://www.gnu.org/software/emacs/'
head 'https://github.com/railwaycat/emacs-mac-port.git'
url 'https://github.com/railwaycat/emacs-mac-port.git', :using => :git, :tag => 'v4.2'
version 'emacs-24.3-mac-4.2'
depends_on 'automake' => :build
@fgeller
fgeller / emacs.rb
Created October 10, 2012 16:04
Emacs 24.2 Mac Port 3.2 (infodir=~/.emacs.d/info, new icon)
require 'formula'
class EmacsMac < Formula
url 'ftp://ftp.math.s.chiba-u.ac.jp//emacs/emacs-24.2-mac-3.2.tar.gz'
sha1 '8a6c906aa0d8aa3ab36015bdf96e1e31cf17faa6'
end
class Emacs < Formula
homepage 'http://www.gnu.org/software/emacs/'
url 'http://ftpmirror.gnu.org/emacs/emacs-24.2.tar.bz2'