Every response is contained by an envelope. That is, each response has a predictable set of keys with which you can expect to interact:
#!
{
/** | |
* Zip a folder (include itself). | |
* Usage: | |
* HZip::zipDir('/path/to/sourceDir', '/path/to/out.zip'); | |
* | |
* @param string $sourcePath Path of directory to be zip. | |
* @param string $outZipPath Path of output zip file. | |
*/ | |
public static function zipDir($sourcePath, $outZipPath) | |
{ |
private void clear(Scheduler scheduler) { | |
Object quartzScheduler = getFieldValue(scheduler, "sched"); | |
Object jobMgr = getFieldValue(quartzScheduler, "jobMgr"); | |
@SuppressWarnings("unchecked") | |
Map<String, JobExecutionContext> executingJobs = (Map<String, JobExecutionContext>)getFieldValue(jobMgr, "executingJobs"); | |
List<String> removalList = new ArrayList<String>(); | |
for(Map.Entry<String, JobExecutionContext> entry : executingJobs.entrySet()) { | |
if(entry.getValue().getNextFireTime().before(new Date())) { | |
removalList.add(entry.getKey()); |
FROM debian | |
RUN mkdir -p /var/www/server.dev/web | |
WORKDIR /var/www/server.dev | |
RUN apt-get update && apt-get install -y \ | |
aptitude \ | |
apt-utils \ | |
pkg-config \ |
<?php | |
const SECRET_KEY = '2ff58dd1339f33ea688b89753d50e8cfefe82f6fdfb429f4f1dad4e45c04d499'; // Example key | |
const ENCRYPT_METHOD = 'AES-256-CBC'; // Encrypt method | |
const IV = '2ff58dd1339f33ea'; // Random hash with 16 bits. Generate a new IV for each new message | |
$nonEncryptedMessage = 'this message is secret'; | |
// example to encode a message | |
// encrypt and encode the message | |
$encryptedMessage = openssl_encrypt($nonEncryptedMessage, ENCRYPT_METHOD, SECRET_KEY, 0, IV); |
{ | |
"name": "Rafael Meneses", | |
"email": "rafael@petcoach.co", | |
"country": "Brazil", | |
"zip_code": "55544", | |
"pets": [ | |
{ | |
"name": "Ryley", | |
"policy_number": "WAG6053240", | |
"pet_type": "Dog", |
<input type='text' id="textBox"> |
<?php | |
namespace MyCode; | |
class TestClass extends TestCase { | |
/** | |
* MySQL table | |
* @var array | |
*/ | |
private array $users = []; |
/** | |
* Check if a WebP image is animated | |
* @param {*} url | |
* @returns boolean | |
*/ | |
async function isWebPAnimated(url) { | |
try { | |
const response = await fetch(url); | |
const buffer = await response.arrayBuffer(); | |
const dataView = new DataView(buffer); |
<?php | |
$webpFilePath = 'new.jpeg'; | |
$byteArray = array_values(unpack('C*', file_get_contents($webpFilePath))); | |
$byteString = implode(array_map('chr', $byteArray)); | |
echo base64_encode($byteString); |