Skip to content

Instantly share code, notes, and snippets.

View chadcatlett's full-sized avatar

Chad Catlett chadcatlett

  • Somewhere in Texas
View GitHub Profile
@chadcatlett
chadcatlett / scar_tissue.md
Created July 1, 2023 04:02 — forked from gtallen1187/scar_tissue.md
talk given by John Ousterhout about sustaining relationships

"Scar Tissues Make Relationships Wear Out"

04/26/2103. From a lecture by Professor John Ousterhout at Stanford, class CS142.

This is my most touchy-feely thought for the weekend. Here’s the basic idea: It’s really hard to build relationships that last for a long time. If you haven’t discovered this, you will discover this sooner or later. And it's hard both for personal relationships and for business relationships. And to me, it's pretty amazing that two people can stay married for 25 years without killing each other.

[Laughter]

> But honestly, most professional relationships don't last anywhere near that long. The best bands always seem to break up after 2 or 3 years. And business partnerships fall apart, and there's all these problems in these relationships that just don't last. So, why is that? Well, in my view, it’s relationships don't fail because there some single catastrophic event to destroy them, although often there is a single catastrophic event around the the end of the relation

#include "pch.h"
#include <winrt/Windows.Gaming.Input.h>
#include <winrt/Windows.Devices.Power.h>
using namespace winrt;
using namespace Windows::Gaming::Input;
int main()
{
init_apartment();
printf("Attempting to enumerate all gamepads\n");
@chadcatlett
chadcatlett / keybase.md
Created November 23, 2019 00:49
keybase.md

Keybase proof

I hereby claim:

  • I am chadcatlett on github.

  • I am chadcatlett (https://keybase.io/chadcatlett) on keybase.

  • I have a public key ASD6-nNBFBRi4SysHEkJplrPf0zun2lBAvHuaNQVW5Mx3Ao

@chadcatlett
chadcatlett / urldecode.jq
Created February 16, 2019 01:05
no idea where i found this
def urldecode:
def unhex:
if 48 <= . and . <= 57 then . - 48 elif 65 <= . and . <= 70 then . - 55 else . - 87 end;
def bytes:
def loop($i):
if $i >= length then empty else 16 * (.[$i+1] | unhex) + (.[$i+2] | unhex), loop($i+3) end;
[loop(0)];
def codepoints:
# Usage: convert os_device
# Convert an OS device to the corresponding GRUB drive.
# This part is OS-specific.
convert () {
# First, check if the device file exists.
if test -e "$1"; then
:
else
echo "$1: Not found or not a block device." 1>&2
exit 1
diff --git a/configure.yml b/configure.yml
index 3ee5669..7ade25e 100644
--- a/configure.yml
+++ b/configure.yml
@@ -1,4 +1,4 @@
-- hosts: 127.0.0.1
+- hosts: localhost
connection: local
gather_facts: False
roles:
def disable_proxy(kick_token):
path = '/etc/sysconfig/rhn/up2date'
mode = 0600
tempfd, temp_path = mkstemp()
try:
new_file = open(temp_path, 'w')
old_file = open(path)
except (IOError, OSError) as err:
klog(kick_token, 'Problem disabling proxy for RHN <%s>.' % str(err))
return False
#!/bin/sh
dur=$1
if [ "$dur" = "" -o ! -e "$dur" ]; then
echo "no package supplied" 1>&2
exit 1
fi
leadsize=96
o=`expr $leadsize + 8`
set `od -j $o -N 8 -t u1 $dur`
il=`expr 256 \* \( 256 \* \( 256 \* $2 + $3 \) + $4 \) + $5`
#!/usr/bin/env python
get_lenlist = lambda input_data: dict([(key,max([len(str(key))]+[len(str(i[key])) for i in input_data])) for key in input_data[0].keys()])
get_rowformat = lambda length_data: " | ".join('%%-%ss' % max_length for key, max_length in length_data.iteritems())
get_divider = lambda length_data: "-|-".join("-"*max_length for key, max_length in length_data.iteritems())
get_header = lambda length_data: get_rowformat(length_data) % tuple(length_data.keys())
records = [
{ 'name':'Billy Bob', 'Hobby': 'Guns'},
require 'formula'
class Weechat < Formula
homepage 'http://www.weechat.org'
url 'http://www.weechat.net/files/src/weechat-0.4.1.tar.bz2'
sha1 'a5185d6b8a2b330713ea354f06601a205270e3a2'
depends_on 'cmake' => :build
depends_on 'gnutls'
depends_on 'libgcrypt'