Skip to content

Instantly share code, notes, and snippets.

View Lexmark-anmaiti's full-sized avatar
🏠
Back to Office

Anupam Maiti Lexmark-anmaiti

🏠
Back to Office
View GitHub Profile
@Lexmark-anmaiti
Lexmark-anmaiti / countryAndLanguageFromIosOrAndroidLocale.js
Created August 10, 2021 11:39 — forked from stephan-nordnes-eriksen/countryAndLanguageFromIosOrAndroidLocale.js
JavaScript/Node.js Get Country from iOS or Android locale string
/**
* Get the country code (ISO 3166-1 alpha-2) from a valid locale string from Android or iOS.
* Valid locale strings are described here:
* ios: https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPInternational/LanguageandLocaleIDs/LanguageandLocaleIDs.html
* android: https://developer.android.com/reference/java/util/Locale.html
*
* Tested with ava.
*
* @param {*string} localeString The locale string from android or ios
*/
<head data-sly-use.clientLib="${'/libs/granite/sightly/templates/clientlib.html'}">
<!--/* for css+js */-->
<meta data-sly-call="${clientLib.all @ categories='your.clientlib'}" data-sly-unwrap></meta>
<!--/* only js */-->
<meta data-sly-call="${clientLib.js @ categories='your.clientlib'}" data-sly-unwrap></meta>
<!--/* only css */-->
<meta data-sly-call="${clientLib.css @ categories='your.clientlib'}" data-sly-unwrap></meta>
@Lexmark-anmaiti
Lexmark-anmaiti / remove-all-from-docker.sh
Last active October 5, 2020 10:35 — forked from beeman/remove-all-from-docker.sh
Remove all from Docker
# Stop all containers
docker stop 'docker ps -qa'
# Remove all containers
docker rm 'docker ps -qa'
# Remove all images
docker rmi -f 'docker images -qa'
# Remove all volumes
@Lexmark-anmaiti
Lexmark-anmaiti / docker-cleanup-resources.md
Created July 23, 2020 14:01 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks

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