This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Delete all local branches that have been merged. | |
function delete_merged_branches() { | |
git branch --merged | egrep -v "(^\*|master)" | xargs git branch -d | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn bubble_sort(mut array: Vec<isize>) -> Vec<isize> { | |
let mut swapped: bool; | |
loop { | |
swapped = false; | |
for i in 0..array.len() - 1 { | |
if array[i] > array[i + 1] { | |
let temp = array[i]; | |
array[i] = array[i + 1]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
letsencrypt: | |
image: linuxserver/letsencrypt | |
container_name: letsencrypt | |
restart: unless-stopped | |
network_mode: host | |
volumes: | |
- ./config/letsencrypt:/config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# backup your databases | |
docker exec -t your-db-container pg_dumpall -c -U postgres > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql | |
# restore your databases | |
cat your_dump.sql | docker exec -i your-db-container psql -U postgres |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const dns = require('dns').promises; | |
/** | |
* Check connection to internet. | |
* | |
* @return {Promise<Boolean>} Whether there is connection to internet or not. | |
*/ | |
exports.checkInternet = function checkInternet() { |