Skip to content

Instantly share code, notes, and snippets.

Avatar
:octocat:

Khaled Monsoor kmonsoor

:octocat:
View GitHub Profile
@kentcdodds
kentcdodds / README.md
Last active Jun 9, 2021
user-package-stats
View README.md

user-package-stats

I was poking around trying to figure out all the packages I have access to publish and got curious. So I write this little script to determine the download stats for all the packages I have publish access to.

Feel free to try it yourself. Just change the username passed to getUserDownloadStats.

By default, the stats are sorted by their average daily downloads (descending). That should give you an idea of the most "popular" package of a given user relative to how long that package has been around.

You can use it with npx like so:

@larshaendler
larshaendler / rename_multiple_files.md
Created Jan 21, 2019
Rename multiple files with prefix or suffix in Linux console
View rename_multiple_files.md

Add a suffix

for file in *; do mv "$file" "$(basename "$file")yourSuffix"; done;

Exmpale to add an underscore "_" at the end each text file:

for file in *.txt; do mv "$file" "$(basename "$file")_"; done;

Add a prefix

@nirzaq
nirzaq / option.txt
Created Apr 24, 2018
Available Option
View option.txt
'abandoned',
'beach',
'bike',
'birthday',
'broken',
'breakfast',
'business',
'cake',
'car',
'cat',
@p4kl0nc4t
p4kl0nc4t / revip.py
Created Mar 10, 2018
RevIP: Simple Reverse IP Lookup Tool
View revip.py
#!/usr/bin/python
# - RevIP
# | Date: 10/03/2018
# | Author: P4kL0nc4t
# | Description: simple reverse IP lookup tool that combines multiple API to achieve effective result.
import requests
import sys
requests.packages.urllib3.disable_warnings()
from socket import gethostbyname
@nuhil
nuhil / js.md
Last active Aug 26, 2019
Javascript Handbook
View js.md
View restart-ssh-gist.sh
killall ssh-agent; eval `ssh-agent`
@bastman
bastman / docker-cleanup-resources.md
Created Mar 31, 2016
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@rvl
rvl / git-pushing-multiple.rst
Created Feb 9, 2016
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.
View git-pushing-multiple.rst

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

@kmonsoor
kmonsoor / pelican_new_MD_post_template.py
Last active Dec 21, 2015
Create a new MarkDown post for Pelican-generated blog
View pelican_new_MD_post_template.py
"""
author: Khaled Monsoor <k@kmonsoor.com>
modified: 09-Dec-2015
license: The MIT License
"""
import sys
from datetime import datetime