I saw a video that claimed the following mathematical summation…
<?php | |
/** | |
* Class BetterEnum | |
* | |
* A pure-PHP alternative to SplEnum, although only a 99% compatible replacement for it. | |
* | |
* See: http://php.net/manual/en/class.splenum.php | |
* | |
* To declare an enum class, subclass BetterEnum and define the names and values as constants. |
Whenever possible, use GH's "Import repository" feature.
The import feature doesn't always work, though. In my experience, I tried to import a repo and it failed with a generic message. I had to contact GH support to ask for help. They told me my repo had a large file (>100MB), which couldn't be added to GH directly. I had to either remove the file or store it in GH LFS. In this case, one of the CLI methods below are needed:
def time_format(seconds: int) -> str: | |
""" | |
From: https://stackoverflow.com/a/68321739/543738 | |
""" | |
if seconds is not None: | |
seconds = int(seconds) | |
d = seconds // (3600 * 24) | |
h = seconds // 3600 % 24 | |
m = seconds % 3600 // 60 |
<?php | |
require_once 'vendor/autoload.php'; | |
use IMSGlobal\Caliper\actions\Action; | |
use IMSGlobal\Caliper\Client; | |
use IMSGlobal\Caliper\context\Context; | |
use IMSGlobal\Caliper\entities\agent\Person; | |
use IMSGlobal\Caliper\entities\agent\SoftwareApplication; | |
use IMSGlobal\Caliper\entities\media\MediaLocation; | |
use IMSGlobal\Caliper\entities\media\VideoObject; |
I wanted to know: How can I get the current timestamp for UTC in ISO 8601 format to appear in the body data of a Postman request?
After reading some of the Postman documentation and online comments, this is the solution (using Postman v5.0.1 for Chrome 58.0.3029.110 on macOS 10.12.5) I used:
-
In the Builder, while editing a request, click the "Pre-request Script" heading below the URL field.
-
In the editor field that appears, enter this single line of JavaScript:
postman.setGlobalVariable('timestampUtcIso8601', (new Date()).toISOString());
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection | |
import sys | |
import base64 | |
print(sys.argv[1]) | |
PASSWORD_ENCRYPTION_KEY = b"sdf@!#$verf^wv%6Fwe%$$#FFGwfsdefwfe135s$^H)dg" |
# https://stackoverflow.com/questions/39928401/recover-db-password-stored-in-my-dbeaver-connection | |
# requires pycryptodome lib (pip install pycryptodome) | |
import sys | |
import base64 | |
import os | |
import json | |
from Crypto.Cipher import AES |