Skip to content

Instantly share code, notes, and snippets.

View carlzulauf's full-sized avatar

Carl Zulauf carlzulauf

  • Unabridged Software
  • Denver, CO
View GitHub Profile

In the real world, genius is usually the product of obsession rather than some innate superiority. The best people in their fields aren't just super humans with superior minds, they just care about one specific thing in such a way that they are able to develop a level of mastery over it that few could hope to achieve. People might be born with aptitudes. Nobody is born a genius.

Being a genius doesn't mean that you're smarter than everybody else on every subject. It just means that you have one specific field where you're King Shit of Fuck Mountain.

{
"latitude": 39.675707,
"longitude": -104.938809,
"timezone": "America/Denver",
"currently": {
"time": 1581616800,
"summary": "Partly Cloudy",
"icon": "partly-cloudy-day",
"nearestStormDistance": 8,
"nearestStormBearing": 98,
time cur high low
2020-02-13 11:00 24.96 45.5 17.53
2020-02-13 12:00 28.57 45.38 15.33
2020-02-13 13:00 28.96 45.58 18.24
2020-02-13 14:00 29.51 45.58 18.85
2020-02-13 15:00 29.29 45.58 18.18
2020-02-13 16:00 30.29 45.58 17.88
2020-02-13 17:00 28.51 45.58 17.66
2020-02-13 18:00 24.8 45.43 18.06
@carlzulauf
carlzulauf / .irbrc
Created February 9, 2020 05:33
IRB/Pry customizations
require 'pp'
# Enable mapping an array of hashes by key: hashes.map[:key]
Enumerator.send(:define_method, :[]) { |key| map { |obj| obj[key] } }
def r
begin
require 'redis' unless defined?(Redis)
begin
Redis.current.tap(&:info) # needed to know if connection failed
@carlzulauf
carlzulauf / phoronix-dark.js
Last active January 28, 2020 01:30
A Dark Mode script for Phoronix.com
if (/:\/\/(www\.)?phoronix\.com/.test(window.location.href)) {
let bgH = "#333333";
let bgL = "#222222";
let text = "#e0e0e0";
let textH = "#e0e0e0";
let textL = "#aeaeae";
let accent = "#666666";
let css = `
body {
background: ${bgH};
#!/usr/bin/env ruby
# Tool to convert Google motion JPGs (MVIMG) to MP4 video files.
#
# requires exiftool utility (ie: `apt install exiftool`)
# requires exiftool gem (ie: `gem install exiftool`)
#
require 'exiftool'
files = Dir['*.jpg']
@carlzulauf
carlzulauf / openvpn_resolved_wrapper
Last active April 1, 2019 16:06
Script to wrap openvpn, detect DNS settings, and tell systemd-resolved about them
#!/usr/bin/env ruby
OVPN_CONFIG_PATH = "~/path/to/your.ovpn"
require 'open3'
class VpnWrapper
attr_reader :buffer, :local_interface, :local_dns, :pid
def initialize
@carlzulauf
carlzulauf / app
Last active March 14, 2019 18:15
Core .bin files
#!/usr/bin/env ruby
require_relative "lib.rb"
dc "run app #{ARGV.join(' ')}"
@carlzulauf
carlzulauf / pjson
Created June 23, 2018 01:02
Pretty Print JSON
#!/usr/bin/env ruby
# Pretty print json
#
# Reads JSON from file(s) or from STDIN
#
# Usage:
#
# cat my_json.json | pjson
# pjson my_json.json
@carlzulauf
carlzulauf / git-clean-local
Created June 6, 2018 20:01
Clean stale local git branches
#!/usr/bin/env ruby
require 'time'
require 'optparse'
class Cleaner
attr_accessor :whitelist, :blacklist, :cutoff_days, :confirm, :dry_run, :keep, :skip, :remove
def initialize(options = {})
@whitelist = %W(master develop #{local_branch}).uniq