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
@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 / 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 / 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 / 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 / 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 / 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 / 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:

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

Keybase proof

I hereby claim:

  • I am anasaboureada on github.
  • I am aboureada (https://keybase.io/aboureada) on keybase.
  • I have a public key ASBqGxyu2chZwpNZfKYc0I5Ajn8Rqwdpfv1ye0MNdKtj-Ao

To claim this, I am signing this object:

@AnasAboreeda
AnasAboreeda / weather.html
Created December 26, 2021 03:11
weather widget
<html>
<body>
<a class="weatherwidget-io" href="https://forecast7.com/en/52d374d90/amsterdam/" data-label_1="AMSTERDAM" data-label_2="WEATHER" data-theme="original" >AMSTERDAM WEATHER</a>
<script>
!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src='https://weatherwidget.io/js/widget.min.js';fjs.parentNode.insertBefore(js,fjs);}}(document,'script','weatherwidget-io-js');
</script>
</body>
</html>