Skip to content

Instantly share code, notes, and snippets.

View Komar0ff's full-sized avatar
🦧
煙突掃除夫

Ilya Komar0ff

🦧
煙突掃除夫
View GitHub Profile
{
function suite(fiboMax, repeats, fiboLoop) {
function getMedian(args) {
if (!args.length) {return 0};
var numbers = args.slice(0).sort((a,b) => a - b);
var middle = Math.floor(numbers.length / 2);
var isEven = numbers.length % 2 === 0;
return isEven ? (numbers[middle] + numbers[middle - 1]) / 2 : numbers[middle];
@DmitrySoshnikov
DmitrySoshnikov / event-loop.js
Last active December 14, 2023 23:23
Event loop
/**
* Event loop.
*
* Read details here:
* http://dmitrysoshnikov.com/ecmascript/javascript-the-core-2nd-edition/#job
*
* by Dmitry Soshnikov <dmitry.soshnikov@gmail.com>
*/
/**
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 23, 2024 17:36
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@t-mart
t-mart / netrw quick reference.md
Last active March 25, 2024 07:47
A quick reference for Vim's built-in netrw file selector.
Map Action
<F1> Causes Netrw to issue help
<cr> Netrw will enter the directory or read the file
<del> Netrw will attempt to remove the file/directory
- Makes Netrw go up one directory
a Toggles between normal display, hiding (suppress display of files matching g:netrw_list_hide) showing (display only files which match g:netrw_list_hide)
c Make browsing directory the current directory
C Setting the editing window
d Make a directory
@sebmarkbage
sebmarkbage / react-terminology.md
Last active January 9, 2023 22:47
React (Virtual) DOM Terminology
@jameshwang
jameshwang / gist:5335032
Last active February 29, 2024 16:51
Notes on TDD Patterns

Test-Driven Development By Example: Kent Beck

Test-Driven Development Patterns

  1. Isolate Test: If 1 test breaks, it should be 1 problem to fix. Likewise, if 2 break, then 2 fixes. It shouldn't be that 10 test break and 1 fix fixes them all. Isolating tests encourages you to compose solutions out of many highly cohesive, loosely coupled objects.
  2. Test List: Before beginning, write a list of all the tests. However, this doesn't mean write the tests, it means list them. If you write a bunch of tests all at once, you break the cycle of Red, Green, Refactor.
  3. Test First: write tests before you write code. Writing tests first helps you think about design and also helps you focus
  4. Assert First: try to write your assert/expect/should first. It will show what you want to have pass. Then work backwards to "how" you will make that assert pass. What will you have to setup, mock, stub, etc.
  5. Test Data: Try to use real data that makes sense to the reader. Potentially fixtures and factories
  6. Evident
@AliMD
AliMD / gist:3344523
Created August 13, 2012 22:28
All github Emoji (Smiles)

All github Emoji (Smiles)

ali.md/emoji

:bowtie: | 😄 | 😆 | 😊 | 😃 | ☺️ | 😏 | 😍 | 😘 | :kissing_face: | 😳 | 😌 | 😆 | 😁 | 😉 | :wink2: | 👅 | 😒 | 😅 | 😓

😩 | 😔 | 😞 | 😖 | 😨 | 😰 | 😣 | 😢 | 😭 | 😂 | 😲 | 😱 | :neckbeard: | 😫 | 😠 | 😡 | 😤 | 😪 | 😋 | 😷

😎 | 😵 | 👿 | 😈 | 😐 | 😶 | 😇 | 👽 | 💛 | 💙 | 💜 | ❤️ | 💚 | 💔 | 💓 | 💗 | 💕 | 💞 | 💘 | ✨

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 23, 2024 15:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: