Skip to content

Instantly share code, notes, and snippets.

:octocat:
🤘Grokking Out 🤘

Matt Petty lodestone

:octocat:
🤘Grokking Out 🤘
Block or report user

Report or block lodestone

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@lodestone
lodestone / rails_annotate_query.rb
Created May 2, 2019
Example of annotating a sql query from Rails
View rails_annotate_query.rb
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 Mar 26, 2019 — forked from ttscoff/searchlink.rb
SearchLink creates Markdown links from automatic searches based on special syntax.
View searchlink.rb
@lodestone
lodestone / HOWTO-Dissassociate-Xcode-From-All-File-Types.md
Created Feb 15, 2019
HOWTO: Dissassociate/Unassociate Xcode from ALL file types in one fell swoop!
View HOWTO-Dissassociate-Xcode-From-All-File-Types.md

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 Oct 4, 2018
My zshrc FZF environment variables
View .zshrc
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 Aug 27, 2018
Vim Tip 'o the Day 2018-08-27
View Tip-2018-08-27.vim
" 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 Aug 27, 2018
Vim Tip of the Day 2018-08-27
View 2018-08-27.vim
" 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>
View shanes-pom-timer.py
#! 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)
View shanes-pom-timer.py
#! 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 Apr 6, 2018 — 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…
View tumblr-to-middleman.rb
#!/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 Mar 19, 2018
A Small Ruby vs Crystal Comparison
View _intro.md

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.

You can’t perform that action at this time.