Skip to content

Instantly share code, notes, and snippets.

View rchod's full-sized avatar
💭
(╯°□°)╯︵ ┻━┻

rachid O rchod

💭
(╯°□°)╯︵ ┻━┻
  • France
View GitHub Profile
@rchod
rchod / netscape_cookies_format_from_console.js
Created January 19, 2022 14:44
Netscape-formatted cookies will be in your system's clipboard
copy('# Netscape HTTP Cookie File\n' + document.cookie.split(/; /g).map(e => e.replace('=', '\t')).map(e => window.location.hostname.replace('www.', '.') + '\tTRUE\t/\tFALSE\t-1\t' + e).join('\n'))
@rchod
rchod / .zshrc
Created September 28, 2021 09:51 — forked from kenziebottoms/.zshrc
oh-my-zsh shortcuts
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=~/.oh-my-zsh
DEFAULT_USER="mckenzie"
ZSH_THEME="kenziebottoms"
@rchod
rchod / clean_code.md
Created March 11, 2021 02:50 — forked from wojteklu/clean_code.md
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

// to be run from current directory (e.g app/src/ )
const fs = require('fs');
const path = require('path');
const REGEX = /beforeEach\(async\((.+?)\)\.compileComponents\(\);\n\s+}\)\);$/gms;
function readDirR(dir) {
return fs.statSync(dir).isDirectory()
? Array.prototype.concat(
...fs.readdirSync(dir).map(f => readDirR(path.join(dir, f))),
@rchod
rchod / coverage.js
Created February 27, 2018 17:02 — forked from ebidel/coverage.js
CSS/JS code coverage during lifecycle of page load
/**
* @author ebidel@ (Eric Bidelman)
* License Apache-2.0
*
* Shows how to use Puppeeteer's code coverage API to measure CSS/JS coverage across
* different points of time during loading. Great for determining if a lazy loading strategy
* is paying off or working correctly.
*
* Install:
* npm i puppeteer chalk cli-table
@rchod
rchod / Install-nginx-with-http2-support.md
Created January 5, 2017 23:40 — forked from hollodotme/Install-nginx-with-http2-support.md
Install nginx with http2 support on ubuntu 14.04 LTS (Trusty)

How to install nginx (>= 1.9.5) with http2 support on Ubuntu 14.04 LTS (Trusty)

IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!

Remove old nginx

Remove old nginx incl. nginx-common:

apt-get autoremove --purge nginx nginx-common
@rchod
rchod / rxjs_operators_by_example.md
Created January 5, 2017 14:31 — forked from btroncone/rxjs_operators_by_example.md
RxJS 5 Operators By Example
@rchod
rchod / git-cheat-sheet.md
Created November 22, 2016 11:26 — forked from prograhammer/git-cheat-sheet.md
Git cheat sheet for some useful Git commands and command scenarios.