Skip to content

Instantly share code, notes, and snippets.

View ericandrewlewis's full-sized avatar

Eric Lewis ericandrewlewis

View GitHub Profile

On programming

Cyclomatic complexity

"I'm not sure I can easily explain what this code is doing" - Gregory Cornelius

Blackboxing

"Smart data structures and dumb code works a lot better than the other way around" - Eric S. Raymond, The Cathedral and the Bazaar

@ericandrewlewis
ericandrewlewis / gist:f332341aed8528b636f7
Created April 7, 2015 01:57
On Making an Emoji Keyboard
http://www.unicode.org/Public/emoji/1.0/emoji-ordering.html
@ericandrewlewis
ericandrewlewis / gist:f40a7d33729afd787738
Last active June 7, 2019 13:13
Notes On Digital Analytics Fundamentals

Notes On Digital Analytics Fundamentals

Segments1 isolate subsets of your data for analysis. For example, you may want to view trends in how mobile users are interacting with the site. Segments are persistent throughout the Google Analytics interface — they travel with you through each screen. Google Analytics comes with default segments, e.g. Bounced Sessions, Direct Traffic, returning users, tablet users. Custom segments can be created as well, such as NYT web subscribers, NYT home delivery subscribers, etc.

Context compares recorded metrics against either external data (e.g. industry averages) or internal data (e.g. expected unique sessions).

Conversions are desirable user behaviors. A macro-conversion is a heavily desired behavior, e.g. buying a product. A micro-conversion is a behavior that is on the way towards making a macro-conversion, e.g. clicking to read the specs on a product.

Attribution is assi

On snowboarding

There are three mechanisms you have as a snowboarder: tilt, rotation, and shift.

When you press your foot forward toward your toes or backward onto your heels, that is tilt.

When you turn your hips one way or the other, that is rotation.

When you shift your weight onto your front or back foot, that is shift.

@ericandrewlewis
ericandrewlewis / gist:a5bc6c31b840a556a813
Last active March 18, 2022 08:46
Notes on making a keyboard

Notes on making a keyboard

Instructions for making a 60% keyboard with an abbreviated navigation cluster.

Parts & Tools

  • A keycap is the part of the key that the user touches. It is non-mechanical, it is just a piece of plastic. It sits on top of a switch.
  • A switch is the electro-mechanical component that, when compressed, makes an electronic connection.
  • Switches are wired to a controller, which aggregates keypress info and tells the target device (e.g. Macbook Pro) what to do over USB.
  • Switches sit on either a PCB or a piece of metal.
  • The PCB or piece of metal sits inside a case.
@ericandrewlewis
ericandrewlewis / gist:ac8225af1451ae508e71
Last active August 29, 2015 14:16
Notes on making explainshell a command-line utility

Notes on making explainshell a command-line utility

Explainshell.com is the website's back-end. It downloads manpages from Ubuntu's website and parses them into a useful format stored inside a mongo database. When a command is "explained," the line is parsed by Idan's bash lexical parser, a Python port of GNU's internal bash parser.

The man command outputs documentation for a program (e.g. man git-stash). The output is based on a source file that's written in a markup language named troff. Running man -w git-stash surfaces its filepath on the computer.

Wants

  • Remove the separate step of downloading the manpage files. Look for the command's manpage sourcefile on the host computer, feed it into the process as input in the proper place.
@ericandrewlewis
ericandrewlewis / gist:d5857c25628290b96671
Last active August 29, 2015 14:15
Possible output for an explain shell command
$ explain "rm -rf *"
rm -rf *
└── rm remove files or directories
   ├── -r remove directories and their contents recursively
├── -f ignore nonexistent files, never prompt
└── * Remove (unlink) the FILE(s).
@ericandrewlewis
ericandrewlewis / LICENSE
Last active October 19, 2023 14:03
Circles on an Axis in a Static Force Layout
The MIT License (MIT)
Copyright (c) 2016 Eric Andrew Lewis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH
@ericandrewlewis
ericandrewlewis / gist:01336e4817c41636b2f4
Created January 18, 2015 00:45
WordPress version data
[{"number":"0.70","features":["texturize","autop","Custom Excerpts"],"date":"May 27, 2003","name":""},{"number":"0.71","features":["300% faster","Post statuses (Publish, draft, private)"],"date":"June 9, 2003","name":""},{"number":"0.72","features":["Password protected posts"],"date":"October 11, 2003","name":""},{"number":"1.0","features":["Pretty Permalinks","Multiple Categories per post","Edit wp-config from the browser on install","Comment moderation"],"date":"January 3, 2004","name":"Miles Davis"},{"number":"1.2","features":["Plugin architecture","Custom fields","Sub-categories","Thumbnail creation","Localization and Unicode support"],"date":"January 3, 2004","name":"Charles Mingus"},{"number":"1.5","features":["Kubrick Theme","Flexible theme system","Pages","Admin Dashboard"],"date":"February 17, 2005","name":"Billy Strayhorn"},{"number":"2.0","features":["Redesigned admin interface","AJAX in Admin","WYSIWYG Editor","Skippy’s DB backup plugin included","Akismet plugin included","Resizable Editor","Inlin