Skip to content

Instantly share code, notes, and snippets.

@yuhonas
yuhonas / filco-media-keys.json
Created Aug 18, 2020
karabiner elements media control keys for keyboards that don't have them eg FILCO TKL
View filco-media-keys.json
{
"title": "Media Controls for keyboards that don't have it",
"rules": [{
"description": "Function media keys",
"manipulators": [{
"type": "basic",
"from": {
"key_code": "insert",
"modifiers": {
"mandatory": [
@yuhonas
yuhonas / zsh.md
Last active Aug 15, 2019 — forked from uarun/zsh.md
Zsh Tips & Tricks
View zsh.md

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 / tlds_and_tools_for_development.md
Last active Dec 13, 2018
Which TLD should you be using for development and how to use it
View tlds_and_tools_for_development.md

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
View reverse-history-search.fish
function reverse_history_search
history | fzf --no-sort | read -l command
if test $command
commandline -rb $command
end
end
bind \cr reverse_history_search
View bash3 boilerplate
#!/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
@yuhonas
yuhonas / mysql2-gem-installation
Last active Apr 12, 2018
Failed to build gem native extension error when installing the mysql2 ruby gem on mac with brew installed mysql
View mysql2-gem-installation
# 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
@yuhonas
yuhonas / install-yarn.sh
Created Feb 5, 2018
Install node & yarn on amazon linux
View install-yarn.sh
#!/usr/bin/env bash
# References
# -------------
# https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/setting-up-node-on-ec2-instance.html#w2ab1c23b7c10
# https://gist.github.com/sealocal/0cd468ba4f12cdada436aebe534b40da
set -xe
NODE_VERSION=v9.3.0
View keybase.md

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 / gist:5530727
Created May 7, 2013
Bootstrap Rails dialable phone number view helper
View gist:5530727
def dialable_phone_number(number)
content_tag(:a,
number,
:class => 'visible-phone',
:href => "tel:#{number}"
) + content_tag(:span, number, :class => 'visible-desktop')
end
@yuhonas
yuhonas / gist:4324830
Created Dec 18, 2012
GIT Pre-Commit hook to prevent silly commits of binding.pry/debugger
View gist:4324830
#!/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