Skip to content

Instantly share code, notes, and snippets.

View lenards's full-sized avatar

Andrew Lenards lenards

  • Tucson, AZ
View GitHub Profile
@lenards
lenards / greybeard
Last active March 21, 2024 18:04
Greybeard Definition
Greybeard
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
lenards / just_enough_scala.md
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
lenards / elm-maybe-map-compose.md
Created July 23, 2022 18:31 — forked from JoelQ/elm-maybe-map-compose.md
Refactoring a pipeline of Maybe.map functions in Elm

Refactoring maybe code in Elm

Given this ugly series of cases:

optionalFormattedFriendAddress : Maybe Friend -> Maybe String
optionalFormattedFriendAddress maybeFriend =
  let
    maybeAddress = case maybeFriend of
      Just friend -> Just friend.address
@lenards
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:
http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/MemoryTuning.html
how to configure the jobtracker:
https://github.com/commoncrawl/commoncrawl-crawler/blob/master/bin/launch_emr_parse_job.py#L80
Default Memory setups by EC2 instance type:
@lenards
lenards / just_enough_elm.md
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
lenards / README
Last active November 17, 2020 10:40
See README for context
# A silly attempt as testing ...
## Verification Environment
```
git clone https://gist.github.com/501e788da736ed42d10cdc42c8f4353e.git clank-pr-test
vagrant up
```
```
@lenards
lenards / localdb-and-azure-storage-emulator.md
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
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 }