Skip to content

Instantly share code, notes, and snippets.

@jamesgecko
jamesgecko / code-climate-dark-mode.css
Last active Jan 23, 2021
CodeClimate extension dark mode
View code-climate-dark-mode.css
@media (prefers-color-scheme: dark) {
.cc-alert {
color: var(--color-scale-black);
}
.cc-issue-description {
color: var(--color-scale-black);
}
.cc-ext .cc-issue .ellipsis-expander {
@jamesgecko
jamesgecko / routes
Created Jul 11, 2019
Faster way to search Rails routes from the CLI
View routes
#! /usr/bin/env ruby
# Setup:
# Put this script in your path and make it executable.
# gem install nokogiri
#
# Usage:
# $ routes | grep index
require 'rubygems'
@jamesgecko
jamesgecko / Links in markdown.md
Last active Dec 21, 2018 — forked from jesstelford/Links in markdown.md
Putting links in code blocks on GitHub
View Links in markdown.md
View Copy TargetProcess link
View quiet-mention
#!/usr/bin/env ruby
lookup = {
a: 'a', b: 'b', c: 'c', d: 'd', e: 'e', f: 'f', g: 'g', h: 'h',
i: 'i', j: 'j', k: 'k', l: 'l', m: 'm', n: 'n', o: 'o', p: 'p',
q: 'q', r: 'r', s: 's', t: 't', u: 'u', v: 'v', w: 'w', x: 'x',
y: 'y', z: 'z', A: 'A', B: 'B', C: 'C', D: 'D', E: 'E', F: 'F',
G: 'G', H: 'H', I: 'I', J: 'J', K: 'K', L: 'L', M: 'M', N: 'N',
O: 'O', P: 'P', Q: 'Q', R: 'R', S: 'S', T: 'T', U: 'U', V: 'V',
W: 'W', X: 'X', Y: 'Y', Z: 'Z'
@jamesgecko
jamesgecko / init.lua
Created Aug 10, 2017
hammerspoon config
View init.lua
-- Tap caps lock for esc, use caps lock with another key for ctrl.
send_escape = false
last_mods = {}
control_key_handler = function()
send_escape = false
end
control_key_timer = hs.timer.delayed.new(0.15, control_key_handler)
@jamesgecko
jamesgecko / Vagrantfile
Created Dec 9, 2016
A Vagrantfile suitable for running Rails applications
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
$script = <<SCRIPT
sudo apt-get -y update
sudo apt-get -y install curl git-core python-software-properties ruby-dev libpq-dev build-essential nginx libsqlite3-0 libsqlite3-dev libxml2 libxml2-dev libxslt1-dev nodejs postgresql postgresql-contrib imagemagick autoconf bison libssl-dev libyaml-dev libreadline6-dev zlib1g-dev libncurses5-dev libffi-dev libgdbm3 libgdbm-dev
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
@jamesgecko
jamesgecko / init.lua
Created Nov 1, 2016 — forked from rjhilgefort/init.lua
Hammerspoon config to send escape on short ctrl press
View init.lua
local sendEscape = true
local ctrlKeyTimer = hs.timer.delayed.new(0.15, function()
sendEscape = false
end)
local lastMods = {}
local flagsChangedHandler = function(event)
local newMods = event:getFlags()
if lastMods.ctrl == newMods.ctrl then return false end
View keybase.md

Keybase proof

I hereby claim:

  • I am jamesgecko on github.
  • I am jamesgecko (https://keybase.io/jamesgecko) on keybase.
  • I have a public key ASD4BgjKFTTy4-vz9nmAuD9YjuA9ej80xVJ71J6mM_B3Gwo

To claim this, I am signing this object:

@jamesgecko
jamesgecko / tileset-p8.py
Created Sep 9, 2015
Quick Pico-8 image encoder
View tileset-p8.py
from PIL import Image
PALETTE = ((0,0,0), (29, 43, 83), (128, 37, 83), (0, 135, 81),
(171,82,54), (95,87,79), (194,195,199), (255,241,232),
(255,0,77), (255,163,0), (255,255,39), (0,231,86),
(41,173,255), (131,118,156), (255,119,168), (255,204,170))
def main():
im = Image.open('tilesetP8.png')
px = im.load()