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
// MIT License | |
// Sources below!!! Thank you persons and entities for your code!!! | |
db.product.find({"fieldOne":"findString"}).forEach(doc => { | |
let updatedFieldOne = doc.fieldOne.replace('findString', 'replaceString'); | |
print(doc._id) | |
print(doc.fieldOne) | |
print(updatedFieldOne) | |
db.product.updateOne( |
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
# MIT Licence | |
# MongoDB Import Slowly PowerShell Script | |
# Sources below!!! Thank you all persons and entities!!! | |
$i = 0 | |
$lines = Get-Content .\data.json | |
$lineCount = ($lines | Measure-Object -line).lines | |
Write-Output "Starting import of $lineCount lines." |
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
#!/bin/bash | |
# Copyright 2023 Anton Thelander | |
# License: MIT | |
gradle_properties_file=gradle.properties | |
original_complete_row=$(grep -E "version=.+\..+\..+" $gradle_properties_file) | |
before_minor_v=$(echo $original_complete_row | cut -f1 -d".") | |
original_minor_v=$(echo $original_complete_row | cut -f2 -d".") | |
after_minor_v=$(echo $original_complete_row | cut -f3 -d".") | |
bumped_minor_v=$((original_minor_v+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
#!/usr/bin/env node | |
/* | |
* replace all UTC dates to local datetime with timezone offset through pipe | |
* usage: docker logs -ft container_name | docker-logs-localtime | |
* | |
* Credits: | |
* | |
* docker-logs-localtime, | |
* thank you anton-x-t, | |
* https://gist.github.com/anton-x-t/859a69d0426ed1e4040660f57229c76c |
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
begin | |
-- License for this code: cc by-sa 3.0 | |
-- On executing procedure, thank you Thorsten, https://stackoverflow.com/q/1854427 | |
your_procedure; | |
end; |
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
create or replace procedure your_table_name_dc_proc is | |
-- In the procedure name, dc is short for drop and create. | |
-- On getting advices and tips, thank you very much StackOverflow, stackoverflow.com | |
-- License for this code: cc by-sa 3.0 | |
table_name varchar2(50); | |
procedure drop_table(table_name in varchar2) is | |
begin | |
-- On dropping a table not knowing if the table exists or not, thank you Jeffrey Kemp, https://stackoverflow.com/q/1799128 |
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
// Thank you very much eogiles for earlier written code, credit goes to you. | |
// Thank you very much javajack for earlier written code, credit goes to you. | |
// License for this code: cc by-sa 3.0 | |
// Please get Maven in order for this code to work. | |
// Please get your own imports, you'll probably have to get commons-codec manually by adding it to your POM in Maven: | |
// <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec | |
// To be able to convert to Base64 when making the PasswordDigest token. --> | |
// <dependency> |