Skip to content

Instantly share code, notes, and snippets.

View lenards's full-sized avatar

Andrew Lenards lenards

  • Tucson, AZ
View GitHub Profile
lenards / greybeard
Last active March 21, 2024 18:04
Greybeard Definition
An aging [unix hacker] type with an impressive [unix beard] that has now turned grey. Originally a young [neckbeard], these [Gandalf] resembling [curmudgeons] are renowned for their knowledge of theoretical computer science, arcane unix and complete inability to use a remotely contemporary computer.
Typically employed in academia, they are a dying breed from an antediluvian age of 8" [floppies], magnetic tape and timeshared computing. Despite having invented multiuser OSes and the internet, Greybeards prefer to live in the past, where they consider [Fortran] to be a high level programming language. Typical Greybeard computers are dated [Sun workstations] or old PCs running a command line only [BSD] variant, Greybeards shun GUIs, unless they're horrible and dated, like CDE or [Amiga] Workbench.
Some, like Edsger Dijkstra do most of their computer science as entirely theoretical exercises on paper and haven't programmed a computer since 1972.
Contacting a gr
/* Styles for hiding the native checkbox */
input[type='checkbox'].check-custom {
top: 0;
left: 0;
width: 0;
height: 0;
opacity: 0;
filter: alpha(opacity=0);
position: absolute;
visibility: hidden;
lenards /
Last active October 1, 2022 23:32
A short introduction to Scala syntax and operations reworked and heavily borrowed from Holden Karau's "Scala Crash Course"

Just Enough Scala

(a moderately, well, shameless rework of Holden Karau's "Scala - Crash Course")

Scala is a multi-paradigm high-level language for the JVM.

It offers the ability to use both Object-oriented & Functional approaches.

Scala is statically typed. Type inference eliminates the need for more explicit type declarations.

lenards /
Created July 23, 2022 18:31 — forked from JoelQ/
Refactoring a pipeline of functions in Elm

Refactoring maybe code in Elm

Given this ugly series of cases:

optionalFormattedFriendAddress : Maybe Friend -> Maybe String
optionalFormattedFriendAddress maybeFriend =
    maybeAddress = case maybeFriend of
      Just friend -> Just friend.address
lenards / gist:8786944
Created February 3, 2014 16:18
S3DistCp failure research
This shows you that you can configure the memory for a daemon, but doesn't show jobtracker:
how to configure the jobtracker:
Default Memory setups by EC2 instance type:
lenards /
Last active October 27, 2021 11:50
A short introduction to Elm syntax and operations reworked and heavily borrowed from Holden Karau's "Scala Crash Course"

Just Enough Elm

Elm is a functional programming language that compiles to JavaScript. You can build websites and web applications using it. You can reliably refactor them as the needs and features grow and/or change. It has a goal is simplicity, and it is not just for beginniners.

In short...

  • Reliable refactoring
  • Friendly error messages
  • Enforced semantic versioning (in libraries)
  • No runtime errors (in practice)
lenards / README
Last active November 17, 2020 10:40
See README for context
# A silly attempt as testing ...
## Verification Environment
git clone clank-pr-test
vagrant up
lenards /
Last active July 24, 2020 20:35
Making Azure Storage Emulator Happy (Maybe) ... I hate to add the uncertainty there, but I wrote this up before I had full confirmation of the system working locally and I ended up ripping out all of `sql-server-2017` and getting `sql-server-2019` in place ...

Installing (localdb) on Windows 10

Why? "Sql Local", aka LocalDB is used by the Azure Storage Emulator to mimic the storage interfaces for Azure.

For some reason, installing Sql Server 2017 Developer edition does not offer in "Feature Selection" the ability to include (or add) SqlLocalDB (e.g. LocalDB, or (localdb)).

What to do?

Get the Installer & Install

lenards / ID.elm
Created November 21, 2019 22:24 — forked from Herteby/ID.elm
module ID exposing (ID(..), decodeFromString, decoder, encode, encodeAsString, fromInt, toInt, toString)
import Json.Decode as Decode exposing (Decoder)
import Json.Encode as Encode exposing (Value)
{-| This type ensures you get a type error if you for example accidentally pass a UserId in place of a CompanyId
type ID phantom
= ID Int
module Main exposing (main)
import Browser
import Html exposing (Html, button, div, option, select, text)
import Html.Attributes exposing (selected, value)
import Html.Events exposing (onClick, onInput)
type alias Model =
{ selected : Maybe OptionX }