Skip to content

Instantly share code, notes, and snippets.

View remarkablemark's full-sized avatar

Mark remarkablemark

View GitHub Profile
@remarkablemark
remarkablemark / learning-resources.md
Last active July 11, 2016 20:12
Learning resources pertaining to computer science and other topics.
@marcysutton
marcysutton / chrome-a11y-experiment-instructions.md
Last active February 10, 2025 06:23
Enable Chrome Accessibility Experiment

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:

@Rich-Harris
Rich-Harris / service-workers.md
Last active May 16, 2025 04:55
Stuff I wish I'd known sooner about service workers

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.

@remarkablemark
remarkablemark / vim-tips.md
Last active November 7, 2018 17:10
A collection of useful VIM tips and tricks.

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
@elky
elky / truncate.css
Created September 1, 2016 11:55
text-overflow ellipsis with 100% width
/*
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.
@wojteklu
wojteklu / clean_code.md
Last active May 15, 2025 14:30
Summary of 'Clean code' by Robert C. Martin

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

@david-mark
david-mark / usestrict.md
Last active March 4, 2025 16:38
'use strict' Considered Pointless and Harmful

'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:

@tdlm
tdlm / vim.md
Last active May 17, 2017 16:10
Vim Wizardry
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.
@codediodeio
codediodeio / database.rules.json
Last active May 11, 2025 08:08
Common Database Rules for Firebase
// No Security
{
"rules": {
".read": true,
".write": true
}
}
@remarkablemark
remarkablemark / tmux-cheatsheet.md
Last active March 21, 2021 10:26
tmux cheatsheet

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