Skip to content

Instantly share code, notes, and snippets.

View peterszerzo's full-sized avatar
🥝

Peter Szerzo peterszerzo

🥝
View GitHub Profile
@mhofsche
mhofsche / tech_documentation_guidelines.md
Created April 10, 2019 16:04
Technical documentation guidelines.

Technical Documentation Guidelines

Suggestions for tone of voice for documentation.

  1. Use gender neutral writing
    • Use second person (you), avoid third person (he, she)
      • When you login, create a new password. (instead of) When the user logs in, she creates
      • To log in, enter your login name and password.
    • Use plural nouns and plural pronouns
  • Users can change their password when they click the reset link.
@mikowl
mikowl / oneliners.js
Last active March 28, 2024 20:52
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
@lyoshenka
lyoshenka / search-git-history.md
Last active April 26, 2024 23:16
Search Git commit history for a string and see the diffs

Searching Git commit history

This should be one of the core features of Git, but for some reason it's impossible to figure out how to search for a string in your commit history and see the diffs that that string is in. Here's the best I've come up with:

To find which commits and which files a string was added or removed in:

git log -S'search string' --oneline --name-status

To see the diff of that