Skip to content

Instantly share code, notes, and snippets.

View butlerx's full-sized avatar
:shipit:
shiping all the things

Cian Butler butlerx

:shipit:
shiping all the things
View GitHub Profile
@butlerx
butlerx / cli.py
Created January 7, 2021 17:25
Python cli builder using docstrings and type hinting
"""
Command Line Interface generator and dependency injection
This may seem complex. If you need help understanding or making changes please reach out to @butlerx
"""
from argparse import (
ArgumentParser,
Namespace,
RawDescriptionHelpFormatter,
_SubParsersAction,
)
diff --git a/src/bot.py b/src/bot.py
index 6027a6a..5a4857e 100644
--- a/src/bot.py
+++ b/src/bot.py
@@ -1,7 +1,7 @@
import argparse
from twisted.words.protocols import irc
-from twisted.internet import reactor, protocol
+from twisted.internet import reactor, protocol, ssl
@butlerx
butlerx / muttrc
Created April 23, 2020 11:15
redbrick mail config
## General options
set header_cache = "~/.cache/mutt/headers"
set message_cachedir = "~/.cache/mutt/bodies"
set imap_check_subscribed
unset imap_passive
set imap_keepalive = 300
set mail_check = 60
set editor = `echo \$EDITOR`
set my_name = "Cian Butler"
set realname = "$my_name"
@butlerx
butlerx / graphite_walker.py
Last active July 12, 2019 10:01
async graphite tree walker
#!/usr/bin/env python3
import argparse
import logging
from asyncio import AbstractEventLoop, ensure_future, gather, get_event_loop, sleep
from collections import deque
from typing import Deque, List
import structlog
from aiohttp import BasicAuth, ClientSession, ContentTypeError
@butlerx
butlerx / 404.scss
Created June 8, 2019 19:50
base-16 sass
@import './colours';
@import './variables';
.page-not-found {
h1 {
font-size: 5em;
text-align: center;
}
h2 {
FROM node:alpine
ADD . /app
WORKDIR /app
RUN ["yarn"]
RUN ["yarn", "build"]
FROM nginx:alpine
@butlerx
butlerx / dig
Created February 7, 2019 15:06
dig redbrick.dcu.ie
; <<>> DiG 9.13.5 <<>> redbrick.dcu.ie
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: FORMERR, id: 42452
;; flags: qr rd ad; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available
;; OPT PSEUDOSECTION:
# Server list generated by rankmirrors on 2018-02-07
##
## Arch Linux repository mirrorlist
## Generated on 2018-02-03
##
Server = http://arch.eckner.net/archlinux/$repo/os/$arch
Server = http://arch.jensgutermuth.de/$repo/os/$arch
Server = http://arch.midov.pl/arch/$repo/os/$arch
Server = http://arch.mirror.constant.com/$repo/os/$arch
Server = http://arch.mirror.far.fi/$repo/os/$arch
@butlerx
butlerx / test.conf
Last active April 26, 2018 13:46
apache
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName test.com
ServerAlias www.test.com
DocumentRoot /var/www/test.com/public_html
FallbackResource index.html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
AddType text/html .shtml
AddHandler server-parsed .shtml
@butlerx
butlerx / schema.rs
Last active April 1, 2018 20:44
db schema
table! {
elections(id) {
id -> Integer,
title -> Text,
draft -> Bool,
created_at -> Timestamp,
started_at -> Timestamp,
finished_at -> Timestamp,
}
}