Skip to content

Instantly share code, notes, and snippets.

View Aissaoui-Ahmed's full-sized avatar
🏠
Working from home

Aissaoui Ahmed Aissaoui-Ahmed

🏠
Working from home
View GitHub Profile
@Aissaoui-Ahmed
Aissaoui-Ahmed / .gitconfig
Created July 26, 2023 17:17
gitconfig alias
[alias]
ignore= "!sh ~/.gitScripts/ignore.sh"
@Aissaoui-Ahmed
Aissaoui-Ahmed / ignore.sh
Created July 26, 2023 17:15
gitignore script
#!/bin/bash
lang=$1
if [ ! -n "${lang##+([[:space:]])}" ]; then
echo 'Please add a programming language'
fi
langUpperCase=$(echo $lang | sed 's/./\u&/')
@Aissaoui-Ahmed
Aissaoui-Ahmed / .gitconfig
Last active July 26, 2023 10:57
git alias
[alias]
co = "!f() { git stash; git checkout \"$@\"; git stash pop; }; f"
cob = "!f() { git stash; git checkout -b \"$@\"; git stash pop; }; f"
br = branch --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(contents:subject) %(color:green)(%(committerdate:relative)) [%(authorname)]' --sort=-committerdate
done = !git push origin HEAD
pll= !git pull origin HEAD
lg = !git log --name-only --pretty=format:\"%C(magenta)%h%Creset -%C(red)%d%Creset %s %C(dim green)(%cr) [%an]\" --abbrev-commit -30
undo = reset HEAD~1 --mixed
del = branch -D
s = status
@Aissaoui-Ahmed
Aissaoui-Ahmed / gitignore.sh
Created May 6, 2022 10:17
Download and save gitignore file
# Download and save gitignore file
curl https://raw.githubusercontent.com/github/gitignore/main/<language_programming>.gitignore > .gitignore
# For example Node.JS
curl https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore > .gitignore
# Or python
curl https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore > .gitignore
@Aissaoui-Ahmed
Aissaoui-Ahmed / GitHub-Users_07-Jun-2020.json
Created June 8, 2020 18:23
Count users GitHub by location! 07/06/2020 16:04
[
{
"andorraLow": [
{
"name": "Canillo",
"id": "AD-02",
"CNTRYNAME": "Andorra",
"TYPE": "Parish",
"nameQuery": "Canillo",
"value": 0
@Aissaoui-Ahmed
Aissaoui-Ahmed / GitHub-Users.json
Created December 28, 2019 01:04
count users GitHub by Location! 28/12/2019 2:03
[
{
"andorraLow": [
{
"name": "Canillo",
"id": "AD-02",
"CNTRYNAME": "Andorra",
"TYPE": "Parish",
"value": 0
},
var text;
for (let i = 0; i < document.getElementsByClassName('js-navigation-open').length; i++) {
text += "- \[ \] " + document.getElementsByClassName('js-navigation-open')[i].attributes[1].textContent + "\n";
}