Skip to content

Instantly share code, notes, and snippets.

View mitchty's full-sized avatar

Mitch Tishmack mitchty

  • Saint Paul, MN
View GitHub Profile
@philipashlock
philipashlock / userChrome.css
Created February 8, 2019 20:03
Firefox userChrome.css for use with Tree Style Tab on Mac OS
@namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
/* Adapted from https://www.reddit.com/r/FirefoxCSS/comments/ao3ydl/configuring_firefox_for_tree_style_tab_usage/ */
/* hide native tabs and sidebar header */
#TabsToolbar-customization-target {
visibility: collapse;
}
@chinshr
chinshr / Jenkinsfile
Last active October 16, 2023 09:25
Best of Jenkinsfile, a collection of useful workflow scripts ready to be copied into your Jenkinsfile on a per use basis.
#!groovy
# Best of Jenkinsfile
# `Jenkinsfile` is a groovy script DSL for defining CI/CD workflows for Jenkins
node {
}
@mietek
mietek / set-up-l2tp-ipsec-vpn-on-debian.md
Last active October 22, 2023 12:25
Set up L2TP/IPsec VPN on Debian

Set up L2TP/IPsec VPN on Debian

Set up IPsec

Set up networking

@tel
tel / ParserCombinators.hs
Created November 3, 2014 19:54
Monad transformers and parser combinators
{-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
module ParserCombinators where
{-
We'll build a set of parser combinators from scratch demonstrating how
they arise as a monad transformer stack. Actually, how they arise as a
choice between two different monad transformer stacks!
@ddrown
ddrown / prune
Created October 20, 2014 15:00
Expire quassel backlog
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# run this in the directory ~/.config/quassel-irc.org/
import sqlite3
import time
con = sqlite3.connect('quassel-storage.sqlite')
with con:
@paf31
paf31 / node-haskell.md
Last active April 14, 2021 18:42
Reimplementing a NodeJS Service in Haskell

Introduction

At DICOM Grid, we recently made the decision to use Haskell for some of our newer projects, mostly small, independent web services. This isn't the first time I've had the opportunity to use Haskell at work - I had previously used Haskell to write tools to automate some processes like generation of documentation for TypeScript code - but this is the first time we will be deploying Haskell code into production.

Over the past few months, I have been working on two Haskell services:

  • A reimplementation of an existing socket.io service, previously written for NodeJS using TypeScript.
  • A new service, which would interact with third-party components using standard data formats from the medical industry.

I will write here mostly about the first project, since it is a self-contained project which provides a good example of the power of Haskell. Moreover, the proces

@dreamcat4
dreamcat4 / plex.md
Last active July 7, 2022 04:25
How to Install Plex Media Server on FreeBSD, FreeNAS / NAS4Free / pfSense, with Finch - http://dreamcat4.github.io/finch/

Plex How-To

How to install Plex Media Server. Most of these commands can just be copy-pasted.

Update Finch

Update finch to version 1.25 or newer.

# Finch users should first update to get the latest fixes

[ "$(echo "$(finch --shortver) >= 1.25" | bc)" = 1 ] || sudo finch update -y

@david-christiansen
david-christiansen / FizzBuzzC.idr
Last active August 29, 2022 20:00
Dependently typed FizzBuzz, now with 30% more constructive thinking
module FizzBuzzC
%default total
-- Dependently typed FizzBuzz, constructively
-- A number is fizzy if it is evenly divisible by 3
data Fizzy : Nat -> Type where
ZeroFizzy : Fizzy 0
Fizz : Fizzy n -> Fizzy (3 + n)
@audionerd
audionerd / Forwarding ports from a docker container with Vagrant 1.6.md
Last active June 25, 2019 20:45
Forwarding ports from a docker container with Vagrant 1.6

Forwarding ports from a docker container with Vagrant 1.6

Vagrant 1.6 has a really nice feature which allows you to run a docker environment from any machine that can run Vagrant (even a Mac)

Behind the scenes, Vagrant creates a host VM which runs the docker containers.

The "gotcha" is: Vagrant won't automatically forward ports all the way back from the container->vagrant host VM->your mac. You have to do that step manually, by configuring your own host VM for Vagrant to use for hosting docker containers with. That host VM is told what ports to open.

Here's how I set up a local Wordpress development testing container.

@cunnie
cunnie / pcap_len.c
Last active January 30, 2017 23:17
command to calculate the total length of packets of a libpcap formatted file (removes 20-byte packet overhead)
/*
attributed author: alex medvedev <alexm () pycckue org>
http://seclists.org/tcpdump/2004/q1/266
to compile on OS X Mavericks:
cc pcap_len.c -lpcap -o pcap_len
to use
sudo tcpdump -w /tmp/tcpdump.out
^C
./pcap_len /tmp/tcpdump.out