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 | |
commands=( | |
"dig +short myip.opendns.com @resolver1.opendns.com 2>/dev/null" | |
"echo $(curl -s cloudflare.com/cdn-cgi/trace | grep ip= | cut -d= -f2)" | |
"curl -s ifconfig.me/ip 2>/dev/null" | |
"curl -s ipinfo.io/ip 2>/dev/null" | |
"curl -s icanhazip.com 2>/dev/null" | |
"curl -s checkip.amazonaws.com 2>/dev/null" | |
"curl -s ipecho.net/plain 2>/dev/null" |
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
//inspired by https://www.youtube.com/watch?v=RZBhSi_PwHU | |
function calculatePi(n) { | |
function gcd(a, b) { | |
if (b === 0) return a; | |
return gcd(b, a % b); | |
} | |
var coprime = 0; |
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
DBCollection.prototype.fields = function fields(rowdepth) { | |
var fields = {}; | |
if (typeof rowdepth == 'undefined') | |
depth = 101 * 2; | |
this.find().limit(rowdepth).sort({ | |
_id: -1 | |
}).forEach(function(x) { | |
var rowfields = dotNotateFields(x); | |
for (var i in rowfields) { | |
fields[i] = rowfields[i]; |