Skip to content

Instantly share code, notes, and snippets.

View ColinTheRobot's full-sized avatar

Colin Hart ColinTheRobot

View GitHub Profile
@ColinTheRobot
ColinTheRobot / 1_framework.rb
Created March 31, 2023 15:21 — forked from APiercey/1_framework.rb
Ruby 6 Line Micro Testing Framework
module MT
def self.assert(desc, left, operator, right = nil) = puts (if msgs = self.send(operator, desc, left, right) then failure(msgs) else success(desc) end)
def self.test(desc, &block) ; puts desc ; yield ; puts "\n" end
def self.success(msg) = " \e[32m#{msg}\e[0m"
def self.failure(msgs) = " \e[31m#{msgs.join("\n ")}\e[0m"
end
@ColinTheRobot
ColinTheRobot / rails.rb
Created March 27, 2023 14:32 — forked from castwide/rails.rb
Enhance Rails Intellisense in Solargraph
# The following comments fill some of the gaps in Solargraph's understanding of
# Rails apps. Since they're all in YARD, they get mapped in Solargraph but
# ignored at runtime.
#
# You can put this file anywhere in the project, as long as it gets included in
# the workspace maps. It's recommended that you keep it in a standalone file
# instead of pasting it into an existing one.
#
# @!parse
# class ActionController::Base
@ColinTheRobot
ColinTheRobot / submodules.md
Created June 5, 2018 11:27 — forked from manasthakur/submodules.md
Using git submodules to version-control Vim plugins

Using git-submodules to version-control Vim plugins

If you work across many computers (and even otherwise!), it's a good idea to keep a copy of your setup on the cloud, preferably in a git repository, and clone it on another machine when you need. Thus, you should keep the .vim directory along with your .vimrc version-controlled.

But when you have plugins installed inside .vim/bundle (if you use pathogen), or inside .vim/pack (if you use Vim 8's packages), keeping a copy where you want to be able to update the plugins (individual git repositories), as well as your vim-configuration as a whole, requires you to use git submodules.

Creating the repository

Initialize a git repository inside your .vim directory, add everything (including the vimrc), commit and push to a GitHub/BitBucket/GitLab repository:

cd ~/.vim
@ColinTheRobot
ColinTheRobot / postgres-brew.md
Created January 31, 2018 14:03 — forked from sgnl/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
require 'socket'
module EventEmitter
def _callbacks
@_callbacks ||= Hash.new { |h, k| h[k] = [] }
end
def on(type, &blk)
_callbacks[type] << blk
self
@ColinTheRobot
ColinTheRobot / private.xml
Last active March 24, 2021 03:59 — forked from burtlo/private.xml
TMUX: Rebinding CAPS LOCK to CTRL + B
<?xml version="1.0"?>
<root>
<appdef>
<appname>Terminal</appname>
<equal>com.apple.Terminal</equal>
</appdef>
<item>
<name>TMUX Key Remappings</name>
<item>
<name>TMUX: Right Control to Ctrl+B</name>