Skip to content

Instantly share code, notes, and snippets.

@SalahAmine
SalahAmine / dom_performance_reflow_repaint.md
Created August 30, 2019 13:48 — forked from faressoft/dom_performance_reflow_repaint.md
DOM Performance (Reflow & Repaint) (Summary)

DOM Performance

Rendering

  • How the browser renders the document
    • Receives the data (bytes) from the server.
    • Parses and converts into tokens (<, TagName, Attribute, AttributeValue, >).
    • Turns tokens into nodes.
    • Turns nodes into the DOM tree.
  • Builds CSSOM tree from the css rules.
@SalahAmine
SalahAmine / README.md
Created August 25, 2019 20:47 — forked from remarkablemark/README.md
Classes - ES5 vs ES6

JavaScript Classes - ES5 vs ES6

An example that shows the difference between creating a JavaScript class and subclass in ES5 and ES6.

Reference

@SalahAmine
SalahAmine / cloudera-docker.md
Created July 10, 2019 10:27 — forked from davideicardi/cloudera-docker.md
Running Cloudera with Docker for development/test
@SalahAmine
SalahAmine / python_tests_dir_structure.md
Created March 26, 2019 13:16 — forked from tasdikrahman/python_tests_dir_structure.md
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@SalahAmine
SalahAmine / curl.md
Created November 22, 2018 14:40 — forked from btoone/curl.md
A curl tutorial using GitHub's API

Introduction

An introduction to curl using GitHub's API.

The Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin
@SalahAmine
SalahAmine / remove-ambari-and-hadoop.sh
Created November 19, 2018 14:24 — forked from hourback/remove-ambari-and-hadoop.sh
I'm using this to clean up between installations of Ambari and HDP.
#!/bin/bash
ambari-server stop
ambari-server reset
ambari-agent stop
service mysqld stop
service postgresql stop
python /usr/lib/python2.6/site-packages/ambari_agent/HostCleanup.py
@SalahAmine
SalahAmine / README.md
Created November 14, 2018 15:38 — forked from joyrexus/README.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@SalahAmine
SalahAmine / vagrant-cheat-sheet.md
Created November 2, 2018 13:01 — forked from wpscholar/vagrant-cheat-sheet.md
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)