Skip to content

Instantly share code, notes, and snippets.

Avatar

Andy Marks andeemarks

View GitHub Profile
@andeemarks
andeemarks / slides-to-composite-pdf.sh
Created Aug 19, 2020
Creating a single PDF containing the first slides from a series of presentations
View slides-to-composite-pdf.sh
// 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 {} +
View kata-blt-c4-context.puml
@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 / cloudSettings
Last active Jan 17, 2021
VSCode settings
View cloudSettings
{"lastUpload":"2021-01-17T00:39:28.896Z","extensionVersion":"v3.4.3"}
@andeemarks
andeemarks / gist:103c8859fcf6cad82b446e4d349c4d43
Created Jul 13, 2019
List of architectural ilities (cross-functional requirement categories)
View gist:103c8859fcf6cad82b446e4d349c4d43
(Source: https://en.wikipedia.org/wiki/List_of_system_quality_attributes)
accessibility
accountability
accuracy
adaptability
administrability
affordability
agility
auditability
View test.py
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
Adam Woods' implementation of FEN formatting using match.length to reduce consecutive spaces to numbers
View format-board-as-fen.js
export default board =>
`${chunk(board, 8)
.map(row => row.join(''))
.map(str => str.replace(/\.+/g, match => match.length))
.join('/')} w - - 0 1`;
View subpubnub.py
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 Feb 24, 2018
Exercises from Day 1 of Elixir from 7 More Languages in 7 Days
View day1-exercises.exs
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
View 7mli7d.elm.day2.text-handling.elm
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
View 7mli7d.elm.day2.mouse-click-pos-recording.elm
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 }
You can’t perform that action at this time.