Skip to content

Instantly share code, notes, and snippets.

View yuhonas's full-sized avatar

Clint Plummer yuhonas

View GitHub Profile
@yuhonas
yuhonas / gist:4122118
Created November 21, 2012 00:00
iTerm / Sublime AppleScript
tell application "System Events"
# create an iTerm session if we dont have one
if not (exists (processes where name is "iTerm")) then
tell application "iTerm" to (make new terminal)
end if
tell application "iTerm"
activate
tell the current terminal
set SublimeSessionName to "sublime"
@yuhonas
yuhonas / gist:4324830
Created December 18, 2012 03:48
GIT Pre-Commit hook to prevent silly commits of binding.pry/debugger
#!/bin/sh
# GIT Pre-Commit hook to prevent silly commits of binding.pry/debugger
# Based off http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes
if git rev-parse --verify HEAD >/dev/null 2>&1
then
AGAINST=HEAD
else
# Initial commit: diff AGAINST an empty tree object
@yuhonas
yuhonas / gist:5530727
Created May 7, 2013 06:57
Bootstrap Rails dialable phone number view helper
def dialable_phone_number(number)
content_tag(:a,
number,
:class => 'visible-phone',
:href => "tel:#{number}"
) + content_tag(:span, number, :class => 'visible-desktop')
end

Keybase proof

I hereby claim:

  • I am yuhonas on github.
  • I am yuhonas (https://keybase.io/yuhonas) on keybase.
  • I have a public key ASC5W8h2Rz9fYXMTJlvefOuylYBOktRmXLet6xSE6UztyAo

To claim this, I am signing this object:

@yuhonas
yuhonas / mysql2-gem-installation
Last active April 12, 2018 00:32
Failed to build gem native extension error when installing the mysql2 ruby gem on mac with brew installed mysql
# ensure we have xcode commandline tools installed as we'll be compiling
xcode-select --install
# we can either install the gem manually eg.
# where '0.3.21' is the version of the gem you wish to install
#
# gem install mysql2 -v '0.3.21' -- \
# --with-mysql-config=$(brew --prefix mysql)/bin/mysql_config
#!/usr/bin/env bash
# Bash3 Boilerplate. Copyright (c) 2014, kvz.io
# See https://kvz.io/blog/2013/11/21/bash-best-practices/
set -o errexit
set -o pipefail
set -o nounset
# set -o xtrace
function reverse_history_search
history | fzf --no-sort | read -l command
if test $command
commandline -rb $command
end
end
bind \cr reverse_history_search
@yuhonas
yuhonas / tlds_and_tools_for_development.md
Last active December 13, 2018 14:52
Which TLD should you be using for development and how to use it

Using the right TLD & Tools for Development & Testing

First of all, what TLD’s should you use for development

At the time of writing the list of Reserved TLDs contains 4 different domains specifically for "Testing & Documentation Examples"

  • .test
  • .example
  • .invalid
  • .localhost
@yuhonas
yuhonas / zsh.md
Last active August 15, 2019 04:29 — forked from uarun/zsh.md
Zsh Tips & Tricks

Zsh Tips and Tricks

CD'ing to frequently used directories

setopt auto_cd
cdpath=($HOME/<dir1> $HOME/<dir2>)

Now simply from any dir

@yuhonas
yuhonas / filco-media-keys.json
Created August 18, 2020 23:29
karabiner elements media control keys for keyboards that don't have them eg FILCO TKL
{
"title": "Media Controls for keyboards that don't have it",
"rules": [{
"description": "Function media keys",
"manipulators": [{
"type": "basic",
"from": {
"key_code": "insert",
"modifiers": {
"mandatory": [