Skip to content

Instantly share code, notes, and snippets.

Avatar
👀
I may be slow to respond.

Hamza Hamidi hamzahamidi

👀
I may be slow to respond.
View GitHub Profile
@hamzahamidi
hamzahamidi / .editorconfig
Created Apr 14, 2021
standard editor config for visual studio
View .editorconfig
rpad# Remove the line below if you want to inherit .editorconfig settings from higher directories
root = true
# C# files
[*.cs]
#### Core EditorConfig Options ####
# Indentation and spacing
View bs.py
def validate(num, name):
if not num.isnumeric():
raise ValueError(f'Le format de {name} n\'est pas valide')
output = int(num)
if output < 0 or 100 < output:
raise ValueError(
f'La veleur de {name} doit être comprise entre 0 et 100')
return output
a = input('Entrez la valeur de A: ')
@hamzahamidi
hamzahamidi / scrapper.sh
Created Jul 5, 2020
Download an entire website
View scrapper.sh
wget -r -p -U Mozilla --wait=10 www.website.com
View sorted-array.py
import bisect
class SortedArray:
def __init__(self, array):
self.array = sorted(array)
self.d = len(array)
def add(self, x):
bisect.insort(self.array, x)
def remove(self, x):
del self.array[bisect.bisect_left(self.array, x)]
def median(self):
View .travis.yml
language: node_js
node_js:
- "12"
addons:
chrome: stable
env:
global:
CODECOV_TOKEN=$CODECOV_TOKEN
before_script:
- yarn install
@hamzahamidi
hamzahamidi / karma.conf.js
Last active Mar 10, 2020
karma config for codcov
View karma.conf.js
module.exports = function (config) {
config.set({
...
browsers: ['Chrome', 'ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
}
@hamzahamidi
hamzahamidi / slice-splice-pop.js
Created Jul 24, 2019
difference between slice splice & pop in javascript
View slice-splice-pop.js
let array_1 = [1,2,3,4];
let array_2 = [1,2,3,4];
let array_3 = [1,2,3,4];
array_1.splice(-1,1) // output --> [4] array_1 = [1,2,3]
array_2.slice(0,-1); // output --> [1,2,3] array_2 = [1,2,3,4]
array_3.pop(); // output --> 4 array_3 = [1,2,3]
@hamzahamidi
hamzahamidi / ssh-github.md
Created Jul 10, 2019
Generating a new SSH key and adding it to the ssh-agent
@hamzahamidi
hamzahamidi / git-branch-naming.md
Created Jul 8, 2019
Git Branch Naming Conventions
View git-branch-naming.md

<type>/<name>

<type>

fix      - Code changes linked to a known issue.
feat     - New feature.
hotfix   - Quick fixes to the codebase.
junk     - Experiments (will never be merged).
refactor - A code change that neither fixes a bug nor adds a feature
ci       - Changes to our CI configuration files and scripts (example scopes: Circle, BrowserStack, SauceLabs)
@hamzahamidi
hamzahamidi / detect-js-framework.js
Created Jun 29, 2019 — forked from rambabusaravanan/detect-js-framework.js
Detect JS Framework used in a Website
View detect-js-framework.js
// Pase these lines into website's console ( Ctrl/Cmd + Shift + I )
if(!!window.React ||
!!document.querySelector('[data-reactroot], [data-reactid]'))
console.log('React.js');
if(!!window.angular ||
!!document.querySelector('.ng-binding, [ng-app], [data-ng-app], [ng-controller], [data-ng-controller], [ng-repeat], [data-ng-repeat]') ||
!!document.querySelector('script[src*="angular.js"], script[src*="angular.min.js"]'))
console.log('Angular.js');