This file contains hidden or 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
// simple benchmark for reversing a string in js - source https://medium.com/quick-code/5-ways-to-reverse-a-string-in-javascript-466f62845827 | |
function reverseFor(str){ | |
let reversed = ""; | |
for (var i = str.length - 1; i >= 0; i--){ | |
reversed += str[i]; | |
} | |
return reversed; | |
} | |
function reverseArray(str){ | |
return str.split("").reverse().join(""); |
This file contains hidden or 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 | |
###### | |
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED | |
# TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF | |
# CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | |
# DEALINGS IN THE SOFTWARE. | |
###### |
This file contains hidden or 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
########################################################################################################## | |
########################################################################################################## | |
########################################################################################################## | |
###### Mass Image Filename Corrector and Scaler | |
########################################################################################################## | |
################################################ [rename] Renaming | |
###### | |
###### Renames jpeg/nef/mov/mp4 files from xxxx.jpg, to a timestamp filename, like | |
###### 2015.05.28_15.33.22.jpg, using the date in exif field Exif.Photo.DateTimeOriginal for | |
###### images, and using file modification time for .mov/.mp4 |
This file contains hidden or 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
Math.mult = function(a, b) { | |
var aSplitted = a.toString().split('.'); | |
var bSplitted = b.toString().split('.'); | |
var aDelta = (aSplitted[1] ? aSplitted[1] : "").length; | |
var bDelta = (bSplitted[1] ? bSplitted[1] : "").length; | |
// a * b | |
return ((a * Math.pow(10, aDelta)) * (b * Math.pow(10, bDelta))) / (Math.pow(10, aDelta) * Math.pow(10, bDelta)); | |
}; |