Skip to content

Instantly share code, notes, and snippets.

View thecompez's full-sized avatar
🚀
BUILDING GENY

C O M P Ξ Z thecompez

🚀
BUILDING GENY
View GitHub Profile
<?php
declare(strict_types=1);
// Set up error logging.
ini_set('log_errors', 1);
ini_set('error_log', 'logs/error_log_file.log');
// Disable caching.
header('Cache-Control: no-store, no-cache, must-revalidate, max-age=0');
header('Pragma: no-cache');
<?php
declare(strict_types=1);
// Headers - SET THESE FIRST
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: GET, POST, OPTIONS');
header('Access-Control-Allow-Headers: Content-Type');
// Handle preflight requests
/**
* Sends a test notification by calling the backend endpoint.
* Uses the notificationDetails passed from the frameAdded event.
* @param {Object} notificationDetails - An object containing { url, token }.
*/
async function sendTestNotification(notificationDetails) {
try {
// Send a POST request to store the notification details.
const storeResponse = await fetch("send-notification.php", {
method: "POST",
<?php
declare(strict_types=1);
require '../../lib/vendor/autoload.php';
require "../../lib/core.php";
header('Content-Type: application/json');
class FarcasterWebhookHandler {
private array $webhookData = [];
import QtQuick
Window {
width: 640
height: 480
visible: true
title: qsTr("Hello World")
function jsonApiRequest() {
var xhr = new XMLHttpRequest();
Language: Cpp
AccessModifierOffset: -4
AlignAfterOpenBracket: true
AlignEscapedNewlinesLeft: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: true
@thecompez
thecompez / data.json
Last active September 1, 2023 17:33
How to parse JSON inside C++ and QML
{
"model": [
{
"id": 1,
"name": "Kambiz",
"family": "Asadzadeh"
},
{
"id": 2,
"name": "Hamed",
@thecompez
thecompez / JavaScript Version
Last active September 3, 2020 11:14
JSON example in QML
let myData = [{
id: 1,
name: "Kambiz",
family: "Asadzadeh"
},
{
id: 2,
name: "Sorush",
family: "Rabiei"
},

Keybase proof

I hereby claim:

  • I am KambizaAadzadeh on github.
  • I am KambizAsadzadeh (https://keybase.io/kambizasadzadeh) on keybase.
  • I have a public key ASCACC5olC9iakHXhYPzCaWDzo37zAUp5sHB_kas3pEO5wo

To claim this, I am signing this object: