Skip to content

Instantly share code, notes, and snippets.

View kevinkirkup's full-sized avatar

Kevin S Kirkup kevinkirkup

  • Digital Realty Trust
  • Raleigh, NC
View GitHub Profile
@kevinkirkup
kevinkirkup / AI_ML_Reference.md
Last active April 24, 2024 16:26
AI/ML Reference
@kevinkirkup
kevinkirkup / gist:d87dd09712f3f3589911cfd791386a5f
Created June 6, 2022 18:06 — forked from mprymek/gist:8379066
Elixir metaprogramming example
# This is an example of metaprogramming in the Elixir language.
#
# We will define a domain specific language (DSL) for the definition
# of a service which is watched by several sensors.
# Each sensor watches some property/functionality of the service and
# returns the result of the check.
#
# To determine if the service is functioning properly, we need functions
# to run all the sensors' code and gather the returned data.
#
@kevinkirkup
kevinkirkup / openapi.json
Last active January 25, 2022 14:42
OpenAPI Generator Error
{
"components": {
"responses": {},
"schemas": {
"Location": {
"description": "",
"example": {
"city": "Raleigh",
"country": "USA",
"id": "iFC8QdVzBmC7hC3NhZfwTG",
@kevinkirkup
kevinkirkup / git-commit-template.md
Created January 12, 2022 21:37 — forked from lisawolderiksen/git-commit-template.md
Use a Git commit message template to write better commit messages

Using Git Commit Message Templates to Write Better Commit Messages

One of my colleagues shared an article on writing (good) Git commit messages today: How to Write a Git Commit Message. This excellent article explains why good Git commit messages are important, and explains what constitutes a good commit message. I wholeheartedly agree with what @cbeams writes in his article. (Have you read it yet? If not, go read it now. I'll wait.) It's sensible stuff. So I decided to start following the

@kevinkirkup
kevinkirkup / session.sh
Last active July 1, 2021 17:38
Shell-Fu - Little know command line tools - DoItLive
#!/usr/bin/env sh
# --------------------------------------------------
# DoItLive Session for Shell-Fu - Little know command line tools
# --------------------------------------------------
#doitlive shell: /bin/zsh
#doitlive prompt: default
cd $MERCURY
# tmux intro
@kevinkirkup
kevinkirkup / ex42.ex
Created February 16, 2021 21:09
Exercise 4.2
defmodule Exercise42 do
@moduledoc """
Documentation for `Exercise 4.2`.
"""
require IO
def sort(values) do
router = create_router()
Enum.each(values, fn v -> send(router, {:int, v}) end)
@kevinkirkup
kevinkirkup / no_worky.ex
Last active February 12, 2021 13:55
Search exercise
@doc """
Parse data for a single line of the text file
"""
def parse_line(line, _num, index) do
String.downcase(line)
|> String.to_charlist()
|> Enum.with_index()
|> Enum.chunk_while(
{[], 0},
fn {c, i}, {word, column} ->
defmodule HW1 do
def flatten([]), do: []
def flatten([head | []]), do: [head]
def flatten([[head] | [tail]]), do: [head | flatten(tail)]
def flatten([head | [tail]]), do: [head | flatten(tail)]
def flatten([head | tail]), do: [head | flatten(tail)]
def flatten(head), do: [head]
end
@kevinkirkup
kevinkirkup / HW1.ex
Last active February 10, 2021 13:29
Elixir HW1 - February 9, 2021
require Integer
defmodule HW1 do
def custom_sum(a, b) when is_number(a) and is_number(b), do: {:ok, round(a) + round(b)}
def custom_sum(_, _), do: {:error, :badarg}
def even_length([]), do {:error, :must_be_even}
def even_length(a) when is_list(a) do
@kevinkirkup
kevinkirkup / ip-up.ppp
Last active February 5, 2021 20:57
Forward traffic for a specific IP over a VPN Tunnel on Mac
#!/bin/sh
##################################################
# This gets run every time the VPN is connected
# Save this as /private/etc/ppp/ip-up
##################################################
# ——————————————————————
# Some Host
# ——————————————————————