Skip to content

Instantly share code, notes, and snippets.

View bighairydave's full-sized avatar

David Tyler bighairydave

View GitHub Profile
@bighairydave
bighairydave / examples.md
Created November 5, 2023 17:08 — forked from atoponce/examples.md
Three password generators in ZSH

Each generator yields 128-bit security passwords. Each generator can take an optional numeric password to generate that many passwords. They should be placed in your ~/.zshrc. They are not portable across other shells.

gen-monkey-pass generates visually unambiguous random meaningless strings using Crockford's base32. Requires only ZSH:

% gen-monkey-pass 
9cws91tjck93f0xymjn33cjt7m

% gen-monkey-pass 3

@bighairydave
bighairydave / sonogram.py
Created April 18, 2021 16:42
Sonogram generator borrowed from https://github.com/akkana/scripts
# From https://github.com/akkana/scripts/blob/master/sonogram.py
#!/usr/bin/env python
# plot the waveform and a sonogram for an audio input (e.g. a bird song).
from pylab import *
from matplotlib import *
import wave
import sys
@bighairydave
bighairydave / _feed.xml
Created June 1, 2015 16:13
Jekyll layout for Atom feeds.
---
layout: null
---
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<link href="{{ page.url | prepend: site.url }}" rel="self" type="application/rss+xml" />
<title>{{ page.title }}</title>
<link href="{{ page.url | prepend: site.url }}"/>
<updated>{{ site.time | date_to_xmlschema }}</updated>
@bighairydave
bighairydave / monthlyfeed.rb
Created June 1, 2015 16:08
Monthly Atom feed of Jekyll posts
module Jekyll
class MonthlyFeed < Page
include Convertible
attr_accessor :site, :pager, :name, :ext, :basename, :dir, :data, :content, :output
# Initialize new ArchivePage
# +site+ is the Site
# +month+ is the month
# +posts+ is the list of posts for the month
@bighairydave
bighairydave / archivegenerator.rb
Last active August 29, 2015 14:22 — forked from nlindley/archivegenerator.rb
Collate Jekyll posts by month and year, and create both archive pages and a monthly XML feed
module Jekyll
class ArchiveGenerator < Generator
safe true
def generate(site)
feeddata = {}
collate_by_month(site.posts).each do |month, posts|
page = ArchivePage.new(site, month, posts)
site.pages << page
feeddata[month] = posts
module Jekyll
class ArchivePage < Page
include Convertible
attr_accessor :site, :pager, :name, :ext, :basename, :dir, :data, :content, :output
# Initialize new ArchivePage
# +site+ is the Site
# +month+ is the month
# +posts+ is the list of posts for the month
@bighairydave
bighairydave / gist:8f038e0f9cbad12ba3cb
Last active August 29, 2015 14:14
Add a list of birds specified in YAML front matter to your Jekyll post.
# Place this in your _posts.html layout.
# Add birds to your post in YAML front matter.
# e.g.
# birds:
# - Roc
# - Phoenix
# - Thunderbird
# or
#
# birds: [Roc, Phoenix, Thunderbird]
@bighairydave
bighairydave / StandardPlus.taskpapertheme
Last active August 29, 2015 14:13
Modified Taskpaper theme partially inspired by tundramonkey / HelvetiCan.taskpapertheme
<theme>
<!-- Window Style -->
<color id="foreground" red="0" green="0" blue="0" alpha="1.0" />
<color id="background" red="1.0" green="1.0" blue="1.0" alpha="1.0" />
<window foregroundColorID="foreground" backgroundColorID="background" shouldUseHUDScrollers="no" />
<!-- Text View Style -->
<color id="tag" red="0.5" green="0" blue="0.5" alpha="1.0" />
<color id="handle" extendsColorID="foreground" />
<color id="insertionPoint" extendsColorID="foreground" />
<theme>
<!-- Window Style -->
<color id="foreground" red="0" green="0" blue="0" alpha="1.0" />
<color id="background" red="1" green="1" blue="1" alpha="1.0" />
<window foregroundColorID="foreground" backgroundColorID="background" shouldUseHUDScrollers="no" />
<!-- Text View Style -->
<color id="tag" red="0.5" green="0" blue="0.5" alpha="1.0" />
<color id="handle" extendsColorID="foreground" />
<color id="insertionPoint" extendsColorID="foreground" />
/* Uses this image: http://dl.dropbox.com/u/5768678/minecraft-sprites/blocks.png */
.block {
background-image: url('blocks.png');
width: 32px;
height: 32px;
}
#cobblestone { background-position: 0px 0px; }
#stone-bricks-1 { background-position: 0px -32px; }
#lapis-lazuli-block { background-position: 0px -64px; }