Skip to content

Instantly share code, notes, and snippets.

Avatar

Jim Myhrberg jimeh

View GitHub Profile
View github-dark-diff-color-customizer.css
/* ==UserStyle==
@name GitHub Dark Diff Color Customizer (customized)
@namespace StylishThemes
@version 2.0.4-custom
@description A diff color customization style, colorblind friendly by default
@author StylishThemes and contributors
@homepageURL https://github.com/StylishThemes/Feature-Override-Styles/
@supportURL https://github.com/StylishThemes/Feature-Override-Styles/issues/new/choose
@updateURL https://gist.githubusercontent.com/jimeh/57b7e6e6e0107036c167f10f87a55861/raw/github-dark-diff-color-customizer.css
@license MIT
View hook_order.md

RSpec Hook Order

The following is a quick reference to exact order of hook execution in RSpec. The output from hook_spec.rb is:

describe: "a thing"
  -> before: all (top)
    -> around: before (top)
      -> before: each (top)
        -> example: "success" (top)
@jimeh
jimeh / bluetooth_sleep.lua
Created Jan 29, 2019 — forked from ysimonson/bluetooth_sleep.lua
Hammerspoon script to disable bluetooth when the computer is put to sleep. Requires `blueutil` to be installed (`brew install blueutil`).
View bluetooth_sleep.lua
function bluetooth(power)
print("Setting bluetooth to " .. power)
result = hs.execute("blueutil --power " .. power)
if result.rc ~= 0 then
print("Unexpected result executing `blueutil`: rc=" .. result.rc .. " type=" .. result.type .. " output=" .. result.output)
end
end
function f(event)
@jimeh
jimeh / .rubocop.yml
Last active Sep 18, 2017
Error in Rubocop 0.50.0's Style/SafeNavigation cop
View .rubocop.yml
AllCops:
TargetRubyVersion: 2.4
View interupt-geeks.coffee
# Let hubot chime in on certain discussions...
module.exports = (robot) ->
robot.hear /rewrite/i, (msg) ->
if shouldSpeak(0.1)
msg.send("#{msg.random(rewriteImages)}#.png")
robot.hear /refactor/i, (msg) ->
if shouldSpeak(0.1)
@jimeh
jimeh / tmux.rb
Created May 13, 2016
Seemingly working Homebrew formula for Tmux 2.2.
View tmux.rb
class Tmux < Formula
desc "Terminal multiplexer"
homepage "https://tmux.github.io/"
stable do
url "https://github.com/tmux/tmux/releases/download/2.2/tmux-2.2.tar.gz"
sha256 "bc28541b64f99929fe8e3ae7a02291263f3c97730781201824c0f05d7c8e19e4"
end
head do
@jimeh
jimeh / chat.go
Created Sep 28, 2015
simple golang chat server
View chat.go
package main
import (
"bufio"
"net"
)
type Client struct {
incoming chan string
outgoing chan string
@jimeh
jimeh / code.rb
Last active Aug 29, 2015
Weird Ruby variable assignment behavior
View code.rb
puts defined?(hello).inspect # => nil
puts "this will not print #{hello.inspect}" rescue nil
hello = 'dude' if false
puts defined?(hello).inspect # => "local-variable"
puts hello.inspect # => nil
# Outputs:
#
# nil
# "local-variable"
View keybase.md

Keybase proof

I hereby claim:

  • I am jimeh on github.
  • I am jimeh (https://keybase.io/jimeh) on keybase.
  • I have a public key whose fingerprint is F0FD DA8B 81F8 3800 1ADF E59E B85A 9E6D 6BBB 670E

To claim this, I am signing this object:

@jimeh
jimeh / Growing my RAID on Mordor.md
Last active Aug 29, 2015
Personal notes from last time I added a disk to my RAID, so I've one got compact place to find all steps next time.
View Growing my RAID on Mordor.md
  1. Prepare disk with gparted:
  2. Terminal: - sudo DISPLAY=:5 gparted
  3. Device > Create Partition Table: - Partition table type: gpt
  4. Partition > New: - Create as: Primary Partition - File system: ext4
  5. Edit > Apply All Operations
  6. Partition > Manage flags: