Skip to content

Instantly share code, notes, and snippets.

View andeemarks's full-sized avatar

Andy Marks andeemarks

View GitHub Profile
@andeemarks
andeemarks / slides-to-composite-pdf.sh
Created August 19, 2020 07:06
Creating a single PDF containing the first slides from a series of presentations
// Convert each presentation to a PDF...
find . -ipath "*pptx" -exec libreoffice --impress --show --convert-to pdf {} \;
// Extract the first page from each PDF into a separate file...
find . -iname "*.pdf" -exec pdfseparate -l 1 {} {}-page%d.pdf \;
// Concat each PDF into a single document
find . -iname "*.pdf" -exec sh -c 'pdfunite "$@" cover-pages.pdf' sh {} +
@startuml C4_Elements
!includeurl https://raw.githubusercontent.com/RicardoNiepel/C4-PlantUML/release/1-0/C4_Context.puml
title Kata - I'll Have The BLT
LAYOUT_TOP_DOWN
Person(customerAlias, "Customer", "")
Person(marketingAlias, "Marketing", "")
@andeemarks
andeemarks / History|-104dcf9f|entries.json
Last active September 15, 2022 09:43
VSCode settings
{"version":1,"resource":"file:///home/amarks/code/exercism/elixir/pangram/lib/pangram.ex","entries":[{"id":"PB00.ex","timestamp":1650836967280},{"id":"oxQb.ex","timestamp":1650836992868},{"id":"mKRv.ex","timestamp":1650837016064},{"id":"ygVo.ex","timestamp":1650837108363},{"id":"S1xC.ex","timestamp":1650837348002},{"id":"olE8.ex","timestamp":1650837584768},{"id":"mMEO.ex","timestamp":1650837619276},{"id":"0eTk.ex","timestamp":1650841076670},{"id":"LsPc.ex","timestamp":1650841129041},{"id":"6Anx.ex","source":"undoRedo.source","timestamp":1650841137893}]}
@andeemarks
andeemarks / gist:103c8859fcf6cad82b446e4d349c4d43
Created July 13, 2019 03:42
List of architectural ilities (cross-functional requirement categories)
(Source: https://en.wikipedia.org/wiki/List_of_system_quality_attributes)
accessibility
accountability
accuracy
adaptability
administrability
affordability
agility
auditability
import csv
import pandas as pd
events = pd.read_csv('data/temperature_events.zip',
compression='infer',
parse_dates={'event_time_index': ['event_time']},
index_col='event_time_index'
)
maxtemps = events.resample('5Min').max()
@andeemarks
andeemarks / format-board-as-fen.js
Created May 8, 2019 06:53
Adam Woods' implementation of FEN formatting using match.length to reduce consecutive spaces to numbers
export default board =>
`${chunk(board, 8)
.map(row => row.join(''))
.map(str => str.replace(/\.+/g, match => match.length))
.join('/')} w - - 0 1`;
from pubnub.callbacks import SubscribeCallback
from pubnub.enums import PNStatusCategory
from pubnub.pnconfiguration import PNConfiguration
from pubnub.pubnub import PubNub, SubscribeListener
import logging
import pubnub
pubnub.set_stream_logger('pubnub', logging.DEBUG)
@andeemarks
andeemarks / day1-exercises.exs
Created February 24, 2018 04:01
Exercises from Day 1 of Elixir from 7 More Languages in 7 Days
defmodule Day1 do
def hypotenuse(side1, side2) do
:math.sqrt((side1 * side1) + (side2 * side2))
end
def word_count(atom_list), do: word_count(atom_list, %{})
def word_count([], map_of_atom_counts), do: map_of_atom_counts
def word_count([head|tail], map_of_atom_counts) do
word_count(tail, Map.put(map_of_atom_counts, head, Map.get(map_of_atom_counts, head, 0) + 1))
end
import Html exposing (Html, text, input, div)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput)
import String
main = Html.program { init = init,
view = view, update = update, subscriptions = \_ -> Sub.none }
-- Model
import Html exposing (Html, text, div)
import Mouse exposing (..)
main = Html.program { init = init,
view = view, update = update, subscriptions = subscriptions }
-- Model
type alias Model = { x: Int, y : Int }