Skip to content

Instantly share code, notes, and snippets.

View trueheart78's full-sized avatar
💖

Josh Mills trueheart78

💖
View GitHub Profile
@trueheart78
trueheart78 / git-functions.sh
Last active January 26, 2021 15:44
Git Init Prompt
# remap git to point to g()
git () {
g "$@"
}
# git super command
# make sure with zsh that the git plugin is not used
# as it will override this command
g () {
if [[ $# -gt 0 ]]
@trueheart78
trueheart78 / web-servers.md
Created May 28, 2021 20:17 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@trueheart78
trueheart78 / remind-me-to.rb
Last active July 23, 2021 18:25
Simple reminder script to flood the terminal.
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'colorize'
end
@trueheart78
trueheart78 / zsh-history-parser.rb
Last active November 7, 2022 19:57
A Z Shell History Parser - Now a git repo! https://github.com/trueheart78/zsh-history-parser
#!/usr/bin/env ruby
require 'etc'
commands = {}
File.readlines(File.join(Etc.getpwuid.dir, '.zsh_history')).each do |l|
l = l.encode('utf-8', 'binary', :undef => :replace)
next if l == ''
next unless l.match(/: \d+:/)
l = l.sub(';','[SPLIT]').split('[SPLIT]')
key = l.last.split.first
@trueheart78
trueheart78 / wow-name.rb
Created April 18, 2023 16:20
WoW Character Name Checker (local)
#!/usr/bin/env ruby
require "colorize"
def wow_name(string)
fits = string.size <= 12
if fits
"=> \"#{string.downcase.capitalize}\" fits and would make a great name! ✅".green
else
# cutoff = string[0...12]
@trueheart78
trueheart78 / kitty-version-check.rb
Last active July 12, 2023 15:24
Kitty version checker 🐈‍⬛
#!/usr/bin/env ruby
require "colorize"
installed_version = `kitty --version`.match(%r:(\d+\.\d+\.\d+):)[1]
# => "0.28.1"
constants_py = `curl --silent https://raw.githubusercontent.com/kovidgoyal/kitty/master/kitty/constants.py`
current_version = constants_py.match(%r:Version\((\d+, \d+, \d+)\)$:)[1].split(',').map(&:to_i).join('.')
# => "0.28.1"