Skip to content

Instantly share code, notes, and snippets.

Avatar

Mark remarkablemark

View GitHub Profile
@Asheq
Asheq / css-display.md
Last active Jul 23, 2020
Compare CSS "display" Property Values
View css-display.md
Behavior inline inline-block block
View tmux-cheatsheet.md

tmux cheatsheet

PREFIX is the prefix key (Ctrl-b is the default). ^d means Ctrl-d. ^D means Ctrl-Shift-d.

Action Command
start a new session tmux
tmux new
tmux new-session
reattach an attached/detached session tmux attach
tmux attach-session
@tdlm
tdlm / vim.md
Last active May 17, 2017
Vim Wizardry
View vim.md
Command Effect
V Visual line highlight.
C-V Visual block highlight.
C-z Suspend Vim and go go shell. Type fg to return to Vim session.
a Append mode.
A Go to end of line and go into insertion mode.
I Go to beginning of line and go into insertion mode.
R Replace mode. (backspace will undo any newly-typed characters!)
o Create a new line below and go into insertion mode.
@david-mark
david-mark / usestrict.md
Last active Nov 2, 2020
'use strict' Considered Pointless and Harmful
View usestrict.md

'use strict' Considered Pointless and Harmful

What is strict mode?

According to the MDN reference, it is:

ECMAScript 5's strict mode is a way to opt in to a restricted variant of JavaScript [sic].

It goes on to say:

@wojteklu
wojteklu / clean_code.md
Last active Jan 25, 2021
Summary of 'Clean code' by Robert C. Martin
View clean_code.md

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@elky
elky / truncate.css
Created Sep 1, 2016
text-overflow ellipsis with 100% width
View truncate.css
/*
Demo: https://jsfiddle.net/elky/f6khaf2t/
<div class="element">
<div class="truncate">
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt
ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco
laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in
voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat
non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
@remarkablemark
remarkablemark / vim-tips.md
Last active Nov 7, 2018
A collection of useful VIM tips and tricks.
View vim-tips.md

Vim Tips

Type Action Command
Editor Reload window :e
:edit
Horizontal split Ctrl w, s
:sp
:split
Vertical split Ctrl w, v
:vs
:vsplit
Switch between windows Ctrl w, (xor Ctrl w, h, j, k, l)
Open new tab :tabe
Go to next tab gt
@Rich-Harris
Rich-Harris / service-workers.md
Last active Jan 20, 2021
Stuff I wish I'd known sooner about service workers
View service-workers.md

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@marcysutton
marcysutton / chrome-a11y-experiment-instructions.md
Last active Sep 18, 2020
Enable Chrome Accessibility Experiment
View chrome-a11y-experiment-instructions.md

NOTE: This is no longer an experiment! You can use the accessibility inspector in Chrome Devtools now, including a fantastic color contrast inspection tool. Read more: https://developers.google.com/web/updates/2018/01/devtools#a11y


Just like any good element inspector helps you debug styles, accessibility inspection in the browser can help you debug HTML and ARIA exposed for assistive technologies such as screen readers. There's a similar tool in Safari (and reportedly one in Edge) but I like the Chrome one best.

As an internal Chrome experiment, this tool differs from the Accessibility Developer Tools extension in that it has privileged Accessibility API access and reports more information as a result. You can still use the audit feature in the Chrome Accessibility Developer Tools, or you could use the aXe Chrome extension. :)

To enable the accessibility inspector in Chrome stable:

@remarkablemark
remarkablemark / learning-resources.md
Last active Jul 11, 2016
Learning resources pertaining to computer science and other topics.