Skip to content

Instantly share code, notes, and snippets.

View lodestone's full-sized avatar
:octocat:
🤘Grokking Out 🤘

Matt Petty lodestone

:octocat:
🤘Grokking Out 🤘
View GitHub Profile
@lodestone
lodestone / rails_annotate_query.rb
Created May 2, 2019 15:29
Example of annotating a sql query from Rails
Post.for_user(user).annotate("fetching posts for user ##{user.id}").to_sql
#=> SELECT "posts".* FROM "posts" WHERE ... /* fetching posts for user #123 */
@lodestone
lodestone / searchlink.rb
Created March 26, 2019 06:54 — forked from ttscoff/searchlink.rb
SearchLink creates Markdown links from automatic searches based on special syntax.
@lodestone
lodestone / HOWTO-Dissassociate-Xcode-From-All-File-Types.md
Created February 15, 2019 20:06
HOWTO: Dissassociate/Unassociate Xcode from ALL file types in one fell swoop!

HOWTO: Disassociate/Unassociate File Types From a Mac App

I got super tired of Xcode opening everything: .rb, .sh, etc etc etc....

Here is how to stop Xcode from opening everything!

NOTE: It may be helpful to know that I found the lsregister command right here:

/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Versions/Current/Support/lsregister
@lodestone
lodestone / .zshrc
Created October 4, 2018 17:42
My zshrc FZF environment variables
export FZF_DEFAULT_COMMAND='fd --type file --color never'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export FZF_DEFAULT_OPTS='--height 50% --min-height=20 --prompt="◉ " --header="⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯⌯" --tabstop=2 --color="dark,fg:#fafafa,info:#555555,prompt:#ff4488,header:#9769c5,info:#8f94fa,border:#5a7ada,pointer:#b143c2,bg+:-1,hl+:#ff00ff,hl:#bc9fec"'
@lodestone
lodestone / Tip-2018-08-27.vim
Created August 27, 2018 12:32
Vim Tip 'o the Day 2018-08-27
" Make backspace do something useful in normal mode:
" - Switch to previous buffer quickly
nnoremap <bs> :b#<CR>
" Make tab do something useful in normal mode:
" - Switch focus to next window.
nnoremap <tab> <c-w><c-w>
@lodestone
lodestone / 2018-08-27.vim
Created August 27, 2018 12:26
Vim Tip of the Day 2018-08-27
" Make backspace do something useful in normal mode:
" - Switch to previous buffer quickly
nnoremap <bs> :b#<CR>
" Make tab do something useful in normal mode:
" - Switch focus to next window.
nnoremap <tab> <c-w><c-w>
#! python3
# smwtimer2.py - A simple countdown script.
# Using datetime
import time, datetime
from subprocess import call
call(["ls", "-l"])
pomStart = datetime.datetime.now()
pomTime = datetime.timedelta(minutes=25)
#! python3
# smwtimer2.py - A simple countdown script.
# Using datetime
import time, datetime
from subprocess import call
call(["ls", "-l"])
pomStart = datetime.datetime.now()
pomTime = datetime.timedelta(minutes=25)
@lodestone
lodestone / tumblr-to-middleman.rb
Created April 6, 2018 17:48 — forked from matiaskorhonen/tumblr-to-middleman.rb
Tumblr blog post extraction code. Pretty much tailored for my needs when I migrated from Tumblr to Middleman, but this might still be of use to someone…
#!/usr/bin/env ruby
require "tumblr_client"
require "time"
require "yaml"
require "fileutils"
require "open-uri"
require "nokogiri"
require "loofah"
require "reverse_markdown"
@lodestone
lodestone / _intro.md
Last active March 19, 2018 13:26
A Small Ruby vs Crystal Comparison

A Small Ruby vs Crystal Test

I recently had to write a quick script to update a text file full of pdf annotations. I wrote the script in Ruby then I wondered how much of a difference in speed I would get if I turned it into Crystal. See below.