Skip to content

Instantly share code, notes, and snippets.

View aliihsansepar's full-sized avatar
👨‍💻

Ali İhsan Şepar aliihsansepar

👨‍💻
View GitHub Profile
@nickcernis
nickcernis / docker-cleanup.md
Last active August 5, 2024 12:34
Docker commands to remove all containers and images

docker kill $(docker ps -q) to kill all running containers
docker rm $(docker ps -a -q) to delete all stopped containers.
docker volume rm $(docker volume ls -q) to delete all volumes.
docker rmi $(docker images -q) to delete all images.

Run all commands:

docker kill $(docker ps -q) && docker rm $(docker ps -a -q) && docker volume rm $(docker volume ls -q) && docker rmi $(docker images -q)

For fish shell, remove the $:

@tlhunter
tlhunter / average-geolocation.js
Created May 17, 2017 18:00
Calculate the center/average of multiple GeoLocation coordinates
/**
* Calculate the center/average of multiple GeoLocation coordinates
* Expects an array of objects with .latitude and .longitude properties
*
* @url http://stackoverflow.com/a/14231286/538646
*/
function averageGeolocation(coords) {
if (coords.length === 1) {
return coords[0];
}
@lucko
lucko / auto-sign-commits-mac.md
Last active April 15, 2024 08:26
Auto-sign commits with IntelliJ on MacOS

Run:

  • brew install gnupg pinentry-mac
  • git config --global user.signingkey <key>
  • git config --global commit.gpgsign true
  • git config --global gpg.program gpg

Then add the following line to ~/.gnupg/gpg-agent.conf:

pinentry-program /usr/local/bin/pinentry-mac
@yemrekeskin
yemrekeskin / TurkishIdNoGenerator.html
Created July 23, 2014 08:33
Random Turkish Identification Number Generator with javascript
<!--
Random Turkish Identification Number Generator
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>