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 / 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 / 5-reasons-to-avoid-atom.markdown
Created February 27, 2014 20:00
Five Reasons You Should Avoid Github's Atom Editor

5 Reasons You Should Avoid Github's Atom Editor

1. There's a Big Hoopla

It must be a passing thing. Just trendy teenagers hopping on the bandwagon. Another fad from an industry that is addicted to it. It must be these things, despite Github's six years of work on it before release. It must be worth avoiding despite the fact that obvious thought, time, and love has been put into the project.

2. It doesn't do X!!!

Yeah, it doesn't do X. It does Y and Z really well, but because it doesn't do X yet it must be eschewed. End of story.

@lodestone
lodestone / gist:ca0adf22a9e64457d45c29c7ce78a718
Created October 17, 2023 09:42 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in
@lodestone
lodestone / eoc.rb
Created August 27, 2012 19:25
Using `EOC` in ruby code scripts.
# Using <<`EOC` in the manner lets you run a longer script from within Ruby easily.
print <<`EOC`
echo "This one is for the bitches"
echo "This ones is too"
EOC
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
MIT License
Copyright (c) 2016 Matt Menzenski
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@lodestone
lodestone / gfxutil.sh
Created October 26, 2021 17:59 — forked from joevt/gfxutil.sh
macOS nvram boot variables, device properties, EFI device paths
#!/bin/bash
# joevt Oct 11, 2021
# https://forums.macrumors.com/threads/documentation-on-all-parameters-for-nvram.2239034/post-28518123
gfxutilcmd=~/Downloads/gfxutil/gfxutil
if [[ ! -f $gfxutilcmd ]]; then
gfxutilcmd=~/Downloads/gfxutil
fi
if [[ ! -f $gfxutilcmd ]]; then
gfxutilcmd="/Volumes/Work/Programming/EFIProjects/gfxutil/joevt-gfxutil/DerivedData/gfxutil/Build/Products/Debug/gfxutil"
@lodestone
lodestone / TrueColour.md
Last active April 30, 2021 13:38 — forked from XVilka/TrueColour.md
Terminal/Console/Shell Color Sequence Cheat Sheet

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
@lodestone
lodestone / colortrans.py
Created January 11, 2017 14:49 — forked from MicahElliott/colortrans.py
Convert values between RGB hex codes and xterm-256 color codes.
#! /usr/bin/env python
""" Convert values between RGB hex codes and xterm-256 color codes.
Nice long listing of all 256 colors and their codes. Useful for
developing console color themes, or even script output schemes.
Resources:
* http://en.wikipedia.org/wiki/8-bit_color
* http://en.wikipedia.org/wiki/ANSI_escape_code
@lodestone
lodestone / me-and-blade-chatting.csv
Last active November 6, 2020 15:36
Log of me and Blade the Vampire Hunter have a chat. (Just testing CSV rendering on gist.github.com)
date person message
2020-10-21 22:04:50 Matt Oh hey! Are you Blade? That half-vampire vampire-hunter?
2020-10-21 22:04:52 Blade ___
2020-10-21 22:05:45 Matt Um. Okay yeah. You're busy all hackin' and slashin' all these vamparoonies about.
2020-10-21 22:04:47 Blade ___
2020-10-21 22:05:55 Matt Uh if you ever want to keep your black leather clothes clean and still hack n slash - you can join my D&D game.
2020-10-21 22:06:08 Blade ___
2020-10-21 22:06:15 Blade I will play this Dee and Dee. On one condition - I must play a bard.
2020-10-21 22:06:25 Blade Text the number carved into the chest of this dying vampire before it turns to dust.
@lodestone
lodestone / appify
Created June 23, 2020 13:17 — forked from mathiasbynens/appify
appify — create the simplest possible Mac app from a shell script
#!/bin/bash
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF
appify v3.0.1 for Mac OS X - http://mths.be/appify
Creates the simplest possible Mac app from a shell script.
Appify takes a shell script as its first argument:
`basename "$0"` my-script.sh