Skip to content

Instantly share code, notes, and snippets.

@fimmtiu
fimmtiu / convert_vscode_keybindings.rb
Last active May 17, 2020 18:04
convert_vscode_keybindings.rb
#!/usr/bin/env ruby
require "json"
CUSTOM_KEYS_FILE = "#{ENV["HOME"]}/Library/ApplicationSupport/Code/User/keybindings.json"
# Some commands are gratuitously different between Mac and Windows.
COMMAND_REPLACEMENTS = {
"workbench.action.files.openFileFolder" => "workbench.action.files.openFile",
}
@fimmtiu
fimmtiu / Key lime pie.md
Last active March 11, 2019 17:49
Key lime pie recipe

Key Lime Pie

Ingredients

  • 1.5 cups graham cracker crumbs (about 9 large rectangular wafers)
  • 100g butter, melted
  • 3 large egg yolks
  • 14 oz. sweetened condensed milk (about 440ml)
  • 1 Tbsp grated lime rind (about 1 small lime's worth)
  • 1/2 cup lime juice (2 to 3 limes' worth)
@fimmtiu
fimmtiu / keybase.md
Created April 23, 2016 17:16
Keybase proof

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@fimmtiu
fimmtiu / .gitconfig
Last active January 19, 2016 19:28
fimmtiu's .gitconfig file
[user]
name = Dennis Taylor
email = dennis.taylor@clio.com
[color]
ui = auto
[alias]
s = status
st = stash
@fimmtiu
fimmtiu / .bashrc
Created January 18, 2016 23:02
fimmtiu's .bashrc file
# Environment variables
export PATH="$HOME/.rbenv/bin:$PATH:$HOME/bin:$HOME/themis/script"
if command -v rbenv >/dev/null; then
eval "$(rbenv init -)"
fi
export ARCHFLAGS="-arch x86_64"
export VISUAL=/Applications/Emacs.app/Contents/MacOS/bin/emacsclient
export EDITOR=$VISUAL
@fimmtiu
fimmtiu / .slate.js
Last active January 19, 2016 21:12
fimmtiu's .slate.js file
// These make windows take up the left half and right half of the screen, respectively.
// I use this for Chrome windows on my Cinema Display.
var halfLeftVertical = slate.operation("push", {
"screen": "0",
"direction": "left",
"style": "bar-resize:screenSizeX/2"
});
var halfRightVertical = slate.operation("push", {
"screen": "0",
@fimmtiu
fimmtiu / gist:930615a9be5f89cb3ece
Created September 10, 2015 21:03
Wrong cipher on sha2-api.xero.com?
CONNECTED(00000003)
write to 0x7fa560d00320 [0x7fa561802000] (130 bytes => 130 (0x82))
0000 - 80 80 01 03 01 00 57 00-00 00 20 00 00 39 00 00 ......W... ..9..
0010 - 38 00 00 35 00 00 16 00-00 13 00 00 0a 07 00 c0 8..5............
0020 - 00 00 33 00 00 32 00 00-2f 00 00 9a 00 00 99 00 ..3..2../.......
0030 - 00 96 03 00 80 00 00 05-00 00 04 01 00 80 00 00 ................
0040 - 15 00 00 12 00 00 09 06-00 40 00 00 14 00 00 11 .........@......
0050 - 00 00 08 00 00 06 04 00-80 00 00 03 02 00 80 00 ................
0060 - 00 ff 84 e1 5d f5 2b f4-93 9a a3 1f 75 e4 6f 3c ....].+.....u.o<
0070 - 8d 31 71 0e 61 5b 1f a3-9f 9d 04 ef 96 a6 e4 85 .1q.a[..........
@fimmtiu
fimmtiu / shazbot.rb
Last active August 29, 2015 14:10
shazbot
TICKS_PER_SECOND = 60
# A heading modified with a certain amount of randomness.
def heading_with_slop(heading, sloppiness_radians)
heading = heading.radians if heading.respond_to?(:radians)
left_side = heading - sloppiness_radians / 2
RTanque::Heading.new(left_side + rand * sloppiness_radians)
end
# A data structore for keeping track of radar contacts.
;; Fix the annoying Emacs if-indentation.
(put 'if 'lisp-indent-function nil)
(setq ring-bell-function 'ignore)
(defconst user-lisp-dir "~/.emacs.d/lisp/")
(add-to-list 'load-path user-lisp-dir)
(byte-recompile-directory user-lisp-dir t)
(defun move-two-spaces-left ()
(interactive)
@fimmtiu
fimmtiu / gist:9958678
Created April 3, 2014 17:13
convert-ruby-hashes
(defun convert-ruby-hashes ()
(interactive)
(query-replace-regexp ":\\([[:word:]_]+\\)\\([[:space:]]+\\)=>[[:space:]]+" "\\1:\\2" nil
(if (and transient-mark-mode mark-active) (region-beginning))
(if (and transient-mark-mode mark-active) (region-end))))
(global-set-key (kbd "C-c h") 'convert-ruby-hashes)