Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View wraithgar's full-sized avatar

Gar wraithgar

  • GitHub Staff
  • Tri-Cities, WA
View GitHub Profile
@wraithgar
wraithgar / gist:3932326
Created October 22, 2012 16:17
Sicilian Rhapsody
Is this a keystore
Is it in memory?
Caught in an event loop
No escape from reality
Open your append-only file
Confirm it's an rdb
I'm just a poor boy
@wraithgar
wraithgar / mfinger.pl
Created November 12, 2015 19:14
Maildir capable finger utility
#!/usr/bin/perl
####################################################
# Maildir Capable Finger Utility #
# v2.0 #
# by Michael Garvin <gar@comrade.us> #
# original can be found at #
# http://sysadminco.com/postfix/scripts/mfinger.pl #
# doesn't check .plan or .project files #
# doesn't check for ~/.nofinger #
@wraithgar
wraithgar / maildirquota-policy.pl
Created November 12, 2015 19:18
Postfix maildir policy server.
#!/usr/bin/perl
##############################################
# Postfix policy server #
# postfix-policyd-quota #
# v1.01 #
# by Michael Garvin <gar@comrade.us> #
# Queries user's maildirquota, and rejects #
# if they are over. Takes no action #
# (DUNNO) otherwise. #

Keybase proof

I hereby claim:

  • I am wraithgar on github.
  • I am wraithgar (https://keybase.io/wraithgar) on keybase.
  • I have a public key whose fingerprint is 0518 2812 06B9 3CC1 CEDF CA40 A9AB 90AE 879B 73AA

To claim this, I am signing this object:

@wraithgar
wraithgar / gist:6431eb458c981fe6c0a8a7ee71754945
Created August 15, 2016 21:46
async foundation validation example
var checkingLogin = false;
var validLogin = true;
var lastCheckedLogin = '';
var checkLogin = Debounce(function (el) {
var code = document.location.search.match(/invite=([^&]*)/);
var val = el.val();
if (code) {
code = code[1];
<!-- REMARK --> - Allows you to put in your own comments so that if you have
to come back later you can figure out what is going on. No one browsing your
Web page will see this unless they view the source.
Example:<!-- This text Cannot be seen by the user unless the source is viewed. -->
<A> - Allows you to anchor things such as a web page by using the following
<A HREF="Http://www.CompuCure.com">
Example:<A HREF="http://www.CompuCure.com">CompuCure</A>
<ABBREV> - Newer command that is coming out in the new HTML3.0 allows you to
@wraithgar
wraithgar / meteorology.html
Created April 11, 2017 17:49
readstuff.online file for meteorology etc
<html>
<script>
var go = function(){
\t parent.postMessage(
{"title":"Meteorology etc","description":"Links to great resources for all your meteorological and other planetary science needs","links":[{"url":"https://www.windytv.com/","description":"Windy TV - See what the wind is up to"},{"url":"https://www.wunderground.com/","description":"Weather Underground - Weather data brought to you by weather enthusiasts"},{"url":"https://earthquake.usgs.gov/earthquakes/map/","description":"USGS Earthquake Map - See what's shakin"},{"url":"http://oceanexplorer.noaa.gov/gallery/maps/maps.html","description":"NOAA Ocean Explorer - Find out if it's truly better down where it's wetter"},{"url":"http://volcano.si.edu/reports_weekly.cfm","description":"Global Volcanism Project - Discover what volcanoes were active this week"},{"url":"http://www.cleardarksky.com/","description":"Dark Sky - Astronomical observing conditions for when you want to look up at the infinite universe."}]}, '*')}
</script>
<body onload='go()'/>
@wraithgar
wraithgar / gist:a0712ee04368e5ecb9b9706ceccd25ca
Created March 19, 2019 16:57
How I picked my 2019 Bracket
ROUND 1
Duke/NC - NC because Duke always reminds me of David Duke and that's a non-starter.
VCU/UCF - UCF. Both remind me of Vets without Borders/ Vets Sans Frontieres so I flipped a coin.
Mississippi State / Liberty - Liberty. Originally I was gonna go w/ mississippi cause it's fun to say but then I tried typing it and I don't want to have to do that again.
Virginia Tech / St Louis - Virginia Tech because there are just too many vowels in Louis and I can NEVER type it right the first try
Maryland / Temple / Belmont - Maryland. Come on Temple / Belmont pick a name.
LSU / Yale - Yale in honor of all the crossword puzzle answers this has provided to me over the years (eli)
Louisville / Minnesota - Minnesota. Oh, ya? Ya, donchaknow
Michigan State / Bradley - Bradley. Duh.
Gonzaga / Fairleigh Dickin... - Fairleigh I have never heard of this college and technically still haven't cause the full name didn't even fit on this site.
const clean = 'bullshit';
let dirty = '';
for (const letter of clean) {
const hex = letter.charCodeAt().toString(16);
dirty = dirty + unescape(`%uDB40%uDD${hex}`);
}
console.log(`Clean: ${clean}`);
console.log(`Dirty: ${dirty}`);
console.log(`Stripped: ${unescape(escape(dirty).replace(/u.{8}/g,''))}`);
@wraithgar
wraithgar / bug.rb
Created December 5, 2019 17:13
ruby strftime/strptime bug
require 'date'
Date.strptime(Date.new(2006,1,1).strftime('%U-%Y'), '%U-%Y')
#<Date: 2006-01-01 ((2453737j,0s,0n),+0s,2299161j)>
Date.strptime(Date.new(2000,12,31).strftime('%U-%Y'), '%U-%Y')
#<Date: 2000-12-31 ((2451910j,0s,0n),+0s,2299161j)>
Date.strptime(Date.new(2001,1,7).strftime('%U-%Y'), '%U-%Y')
#<Date: 2001-01-07 ((2451917j,0s,0n),+0s,2299161j)>
Date.strptime(Date.new(2001,1,1).strftime('%U-%Y'), '%U-%Y')
# Traceback