Skip to content

Instantly share code, notes, and snippets.

View richardcornish's full-sized avatar

Richard Cornish richardcornish

View GitHub Profile
@richardcornish
richardcornish / tar.md
Created January 14, 2024 23:08
Extract and create archive files

tar

Extract and create archive files

Extract

  • -x Extract
  • -z (De)compress archive with gzip
  • -v Verbose
  • -f Location of archive
@richardcornish
richardcornish / typography.md
Last active November 8, 2023 01:02
Common typographical characters

Cheatsheet of common typographical characters (not an exhaustive reference). HTML character references listed are decimal numeric character references, which are the base-10 equivalent of their corresponding base-16 (hexadecimal) Unicode code point. Also see named character references.

Quotations

Glyph HTML reference Name
‘ Left single quotation mark
’ Right single quotation mark/apostrophe
“ Left double quotation mark
Right double quotation mark
@richardcornish
richardcornish / install_python.md
Last active October 5, 2023 01:18
Build and install Python and configuration options with pyenv

Install Xcode Command Line Tools.

xcode-select --install

Install Homebrew.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
@richardcornish
richardcornish / git.md
Last active August 11, 2023 08:44
Enough Git for your résumé in 100ish lines
@richardcornish
richardcornish / subl.sh
Last active August 10, 2023 22:05
Sublime Text CLI `subl` shortcut
ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
@richardcornish
richardcornish / html5_template.html
Last active August 10, 2023 22:02
HTML5 template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
</head>
<body>
<h1>Hello, world!</h1>
</body>
@richardcornish
richardcornish / python_packaging.md
Last active August 10, 2023 21:53
Python packaging cheatsheet

Create

First time only.

mkdir myproject
cd myproject/
python -m venv venv
source venv/bin/activate
git clone git@github.com:username/myproject.git
@richardcornish
richardcornish / design_processes.md
Last active August 10, 2023 21:52
The UX of UX: a comparison of design processes
@richardcornish
richardcornish / javascript_madness.md
Last active August 10, 2023 21:39
An incomplete list of bizarre failings of the JavaScript programming language
  • Prototypal inheritance forces an unstated empty object onto your object with key prototype
  • functions can act as object constructors but with the same syntax
  • empty array members break loops
  • Infinity/-Infinity
  • +0/-0
  • null is an object
  • testing NaN === NaN is always false
  • typeof always returns object" for all different reference types
  • the type of NaN (not a number) is literally "number" but as a string
  • void looks like a Java class but its only job is to return undefined
@richardcornish
richardcornish / add.js
Last active August 10, 2023 21:35
Uses variable-length arguments and closures to create an adding adding function
// H5BP Front-end Developer Interview Questions
// https://github.com/h5bp/Front-end-Developer-Interview-Questions#jscode
// Usage:
// 1 = add(1)();
// 3 = add(1, 2)();
// 6 = add(1, 2)(3);
// 10 = add(1, 2)(3, 4);
// 0 = add()();
var add = function () {