Skip to content

Instantly share code, notes, and snippets.

View slitayem's full-sized avatar
📈

Saloua Litayem slitayem

📈
View GitHub Profile
@slitayem
slitayem / latency.txt
Created September 1, 2020 14:51 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@slitayem
slitayem / yarn-commands.md
Created August 9, 2020 14:13
Yarn commands to manage Yarn applications

List all Yarn aplications in ACCEPTED state

for x in $(yarn application -list -appStates ACCEPTED | awk 'NR > 2 { print $1 }'); do yarn application -kill $x; done

Kill all aplications in RUNNING state

for x in $(yarn application -list -appStates RUNNING | awk 'NR > 2 { print $1 }'); do yarn application -kill $x; done

Kill al spark applications

@slitayem
slitayem / annotated_confusion_matrix.py
Last active July 15, 2020 08:25
Plot annotated confusion matrix for binary classifier
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
import numpy as np
def plot_confusion_matrix(cf_matrix, target_names=None):
"""Plot annotated confusion matrix with absolute values and percentages
Args:
cf_matrix: ndarray of shape (2, 2) Confusion Matrix
"""
@slitayem
slitayem / bibtex.png
Created June 29, 2020 07:01 — forked from max-mapper/bibtex.png
How to make a scientific looking PDF from markdown (with bibliography)
bibtex.png
@slitayem
slitayem / git_utils.md
Last active February 18, 2020 17:27
Git util commands

Push a remote branch to a new remote branch

  1. Add new target remote locally
git remote add <new-remote-name> <new-remote-utl>
git push <new-remote-name> <branch-to-push>:<new-remote-branch>
@slitayem
slitayem / One import via join.yaml
Created November 29, 2018 01:33 — forked from jespereneberg/One import via join.yaml
Fn::ImportValue from other stacks
Tags:
- Key: Name
Value:
!Join ['_', [ ec2, "Fn::ImportValue" : {"Fn::Sub":'${BaseStackName}-Environment'}, test2]]
#This will create a name tag with value: ec2_<yourValueFromOtherStack>_test2
@slitayem
slitayem / coursera-dl.md
Last active July 11, 2018 15:19
Download coursera course
git clone https://github.com/coursera-dl/coursera-dl
cd coursera-dl
mkvirtualenv venv --python=`which python3`
pip3 install -r requirements.txt
./coursera-dl -u <Email-id> -p <Password> --subtitle-language en <course-title>

The coursera title is taken from the course url https://www.coursera.org/learn/

@slitayem
slitayem / aws-cli-tips.md
Last active May 4, 2018 13:54
AWS cli snippets

Get the latest revision of MyTaskDefinition

aws ecs list-task-definitions --family-prefix MyTaskDefinition | jq --raw-output .taskDefinitionArns[0][-1:]
@slitayem
slitayem / README.md
Created February 14, 2018 14:57 — forked from leonardofed/README.md
A curated list of AWS resources to prepare for the AWS Certifications


A curated list of AWS resources to prepare for the AWS Certifications

A curated list of awesome AWS resources you need to prepare for the all 5 AWS Certifications. This gist will include: open source repos, blogs & blogposts, ebooks, PDF, whitepapers, video courses, free lecture, slides, sample test and many other resources.

For more about AWS and AWS Certifications and updates to this Gist you should follow me @leonardofed


@slitayem
slitayem / gist:8340b6a13043576837013135cd711882
Created January 15, 2018 09:27
Minimal VIM configuration
# show existing tab with 4 spaces width
set tabstop=4
# when indenting with '>', use 4 spaces width
set shiftwidth=4
# On pressing tab, insert 4 spaces
set expandtab