Skip to content

Instantly share code, notes, and snippets.

View AnasAboreeda's full-sized avatar
📚
learning one thing about everything and learning everything about one thing

Anas Aboreeda AnasAboreeda

📚
learning one thing about everything and learning everything about one thing
View GitHub Profile
git filter-branch --index-filter "git rm -rf --cached --ignore-unmatch packages/phoenix-data" HEAD
rm -rf .git/refs/original/
git reflog expire --all && git gc --aggressive --prune
@AnasAboreeda
AnasAboreeda / jekyll-and-liquid.md
Created December 13, 2017 09:50 — forked from magicznyleszek/jekyll-and-liquid.md
Jekyll & Liquid Cheatsheet

Jekyll & Liquid Cheatsheet

A list of the most common functionalities in Jekyll (Liquid). You can use Jekyll with GitHub Pages, just make sure you are using the proper version.

Running

Running a local server for testing purposes:

@AnasAboreeda
AnasAboreeda / Bash_scripts.md
Last active November 5, 2017 16:15
Different usefull bash scripts #bash_script #shell_script

Useful Shell scripts

Print all files content in a directory

find . -print0 | while read -d $'\0' file; do cat $file; done

Pick all strings from a binary file

@AnasAboreeda
AnasAboreeda / remove_duplicates.md
Created October 30, 2017 03:48
How to remove duplicate lines in Visual Studio Code?
  1. Type in the search field: ^(.*)(\r?\n\1)+$
  2. type in the "replace with" field: $1
  3. Click "Replace All".
@AnasAboreeda
AnasAboreeda / Clone-all-orgization-repos.sh
Created September 26, 2017 13:54
Clone All organization private/pullic repos
ORGANIZATION=<organization name>
curl -s https://api.github.com/orgs/$ORGANIZATION/repos\?per_page\=200&access_token=<access_token> | grep clone_url | awk -F '"' '{print $4}' | xargs -n 1 -P 4 git clone
@AnasAboreeda
AnasAboreeda / zip_all.sh
Last active September 22, 2017 22:30
[Zip all files in a directory]Zip All files/folders inside a directory except .zip, .git files #zip #compress #Bash #ShellScript
zip -9 -rq $(echo Archive-Name-$(date +%y%m%d%H%M).zip) . -x \*.git\* -x \*.zip\* -x \*.DS_Store\*
@AnasAboreeda
AnasAboreeda / while_promise.js
Created September 17, 2017 12:03
[While Promise] A while promise that returns a promise
// Promise while that return promise
var P = require('bluebird');
var promiseWhile = P.method(function(condition, action) {
if (!condition()) {return;}
return action().then(promiseWhile.bind(null, condition, action));
});
/*
@AnasAboreeda
AnasAboreeda / delete_duplicated_lines.py
Last active September 17, 2017 12:03
[Delete duplicated lines]
import sys
import codecs
if (len(sys.argv) < 2):
print('Usage: python3 ./delete_duplicate_lines.py /path/to/target/file')
sys.exit(1)
def uniquelines(lineslist):
unique = {}
result = []
@AnasAboreeda
AnasAboreeda / cloudSettings
Last active January 25, 2021 12:42
Code settings
{"lastUpload":"2021-01-25T12:41:54.588Z","extensionVersion":"v3.4.3"}
// Atom settings