Skip to content

Instantly share code, notes, and snippets.

View hamzahamidi's full-sized avatar
👀
I may be slow to respond.

Hamza Hamidi hamzahamidi

👀
I may be slow to respond.
View GitHub Profile
@hamzahamidi
hamzahamidi / open-cmder-here.md
Last active February 23, 2024 01:30
"Open Cmder Here" in context menu

"Open Cmder Here" in context menu

Edit 04/2021:

As of the lastest versions, just execute the following command .\cmder.exe /REGISTER ALL per Documentation.

Original Solution

To add an entry in the Windows Explorer context menu to open Cmder in a specific directory, paste this into a OpenCmderHere.reg file and double-click to install it.

@hamzahamidi
hamzahamidi / pagination.js
Last active June 30, 2022 23:34
creates a pagination object (useful to format the result of a DB query)
export const pagination = (paginationParams = {}) => ({
...paginationParams,
limit: paginationParams.limit || 20,
offset: paginationParams.offset || 0,
totalCount: paginationParams.totalCount || 0,
get currentPage() {
return Math.floor(this.offset / this.limit) + 1;
},
get hasNext() {
return this.currentPage * this.limit < this.totalCount;
@hamzahamidi
hamzahamidi / git-branch-naming.md
Created July 8, 2019 15:37
Git Branch Naming Conventions

<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 / .editorconfig
Created April 14, 2021 17:44
standard editor config for visual studio
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
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: ')
github_repo="https://github.com/repo/repo.git"
TAGS=$(git ls-remote --refs --tags ${github_repo} | awk -F/ '{ print $3 }' | awk '{print $NF}')
LATEST_TAG=$(echo $TAGS | awk '{print $(NF-1)}')
echo $LATEST_TAG
@hamzahamidi
hamzahamidi / scrapper.sh
Created July 5, 2020 22:13
Download an entire website
wget -r -p -U Mozilla --wait=10 www.website.com
@hamzahamidi
hamzahamidi / sorted-array.py
Created April 17, 2020 23:35
Sorted Array python
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):
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 March 10, 2020 21:11
karma config for codcov
module.exports = function (config) {
config.set({
...
browsers: ['Chrome', 'ChromeHeadlessNoSandbox'],
customLaunchers: {
ChromeHeadlessNoSandbox: {
base: 'ChromeHeadless',
flags: ['--no-sandbox']
}
}