Skip to content

Instantly share code, notes, and snippets.

View abdessamadely's full-sized avatar

Abdessamad Ely abdessamadely

View GitHub Profile
const getCookieValue = (name) => (
pm.response.headers.get('Set-Cookie').match('(^|;)\\s*' + name + '\\s*=\\s*([^;]+)')?.pop() || ''
)
const jwtToken = getCookieValue('jwt-token')
pm.environment.set("jwtToken", jwtToken)
{
"settings.json": {
"workbench.activityBar.visible": false,
"workbench.startupEditor": "none",
"workbench.iconTheme": "material-icon-theme",
"editor.formatOnSave": true,
"editor.fontSize": 15,
"editor.fontFamily": "MonoLisa, Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.lineHeight": 30,
"debug.console.fontSize": 15,
@abdessamadely
abdessamadely / days-between-dates.py
Created December 29, 2020 22:04
My solution to calculate days between two dates using python
def is_leap_year(year):
if year % 4 != 0:
return False
elif year % 100 != 0:
return True
elif year % 400:
return False
else:
return True
@abdessamadely
abdessamadely / latency.markdown
Created October 3, 2020 17:42 — forked from hellerbarde/latency.markdown
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@abdessamadely
abdessamadely / .bashrc
Last active July 24, 2020 23:52
git bash short PS1
PS1="\[\e[01;32m\]\u\[\e[01;36m\]~\W\[\e[01;33m\]"
PS1+="\[\e[01;33m\] $(__git_ps1 '(%s)')"
PS1+="\[\e[00m\]\$ ";
/* http://meyerweb.com/eric/tools/css/reset/
v2.0-modified | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@abdessamadely
abdessamadely / ContextCmder-Disable.reg
Created June 29, 2020 17:22 — forked from jojobyte/ContextCmder-Disable.reg
Cmder Context (Right-Click) Menu for Windows 7, 8 & 10
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@abdessamadely
abdessamadely / nationalities.json
Created February 19, 2020 20:04 — forked from othmanoss/nationalities.json
list of nationalities english arabic json
{
"Afghan": "أفغاني",
"Albanian": "ألباني",
"Algerian": "جزائري",
"American": "أمريكي",
"Andorran": "أندوري",
"Angolan": "أنغولي",
"Antiguans": "انتيغوا",
"Argentinean": "أرجنتيني",
"Armenian": "أرميني",
@abdessamadely
abdessamadely / cloudSettings
Last active May 18, 2021 18:44
Sync Visual Studio Code
{"lastUpload":"2021-05-18T18:43:57.411Z","extensionVersion":"v3.4.3"}
@abdessamadely
abdessamadely / common-laravel-php-functions-for-automation.php
Created January 6, 2020 18:51
Common functions, for automation with PHP and Laravel
/**
* @param $file_path String
*
* Function to replace all spaces from the files name inside a directory
**/
use Illuminate\Support\Facades\File;
public function addHyphensToFiles($files_path)
{
$files = File::files(public_path('/directory/path'));