Skip to content

Instantly share code, notes, and snippets.

View HazemNoor's full-sized avatar

Hazem Noor HazemNoor

View GitHub Profile
@elsayed85
elsayed85 / imei-eg.sh
Last active January 1, 2025 19:18
Replace 351941237314725 With Your IMEI
curl 'https://api-citizens-prod-imei.gs-ef.com/ceirimeicheck/api/v1/imei/check'
-H 'Host: api-citizens-prod-imei.gs-ef.com'
-H 'Content-Type: application/json'
-H 'Accept: */*'
-H 'Connection: keep-alive'
-H 'Accept-Language: en'
-H 'Content-Length: 34'
-H 'Accept-Encoding: gzip, deflate, br'
-H 'User-Agent: CitizenApp_Ntra/1.0.0 CFNetwork/1568.300.101 Darwin/24.2.0'
--data '{"imeiNumber":["351941237314725"]}'
@sonnysasaka
sonnysasaka / nginx-app.conf
Last active September 10, 2024 09:47
Allow serving static files on Google App Engine second generation PHP flex runtime
# This file is used by App Engine flex environment PHP runtime by name convention nginx-app.conf:
# https://cloud.google.com/appengine/docs/flexible/php/runtime#customize_nginx
# App Engine rewrites everything to index.php$uri, this prevents us to catch
# anything else with `location` block, so the hack is to catch it with another
# rewrite that lets us handle in our own `location ~ ^/myapp` below
# (https://github.com/GoogleCloudPlatform/buildpacks/blob/ff2ea2737a928087dcec192bf3ce103dc356ad5e/pkg/nginx/nginx.go#L93)
rewrite ^/index.php(.*)$ /myapp$1;
# Handle this our way first because we want to try serving a file if it matches,
@danilopolani
danilopolani / Controller.php
Created June 29, 2023 09:09
Zendesk webhook signature validation with Laravel
<?php
// $request comes from your Controller method, but you can adjust with whatever framework you use
$signature = $request->header(ZendeskSupport::WEBHOOK_SIGNATURE_HEADER),
$timestamp = $request->header(ZendeskSupport::WEBHOOK_SIGNATURE_TIMESTAMP_HEADER),
$rawBody = $request->getContent();
$computedSignature = base64_encode(hash_hmac(
'sha256',
@FeepingCreature
FeepingCreature / youre_doing_json_apis_wrong.md
Last active March 14, 2025 09:16
You Are Doing JSON APIs Wrong

You are doing JSON APIs wrong.

When you use JSON to call an API - not a REST API, but something like JSON-RPC - you will usually want to encode one of several possible messages.

Your request body looks like this:

{
 "type": "MessageWithA",
@DarkGhostHunter
DarkGhostHunter / log-levels.csv
Last active March 12, 2022 04:38
Log levels table
Property / Log Level Debug Info Notice Warning Error Critical Alert Emergency
Disposable X
Statistical X X X X X X X
Relevant X X X X X X
Undersired X X X X X
Unstable X X X X
Stateful X X X
Unsecure X X
Unfixable X
@cybertiwari
cybertiwari / calculateDistance.php
Created October 31, 2021 16:14
Calculate distance between two latitude and longitude in php using the Great-circle distance formulae
<?php
function calculateDistance($firstLatitude, $firstLongitude, $secondLatitude,$secondLongitude)
{
//get polar angle θ (theta) (angle with respect to polar axis)
$theta = $firstLongitude - $secondLongitude;
$radians = sin(
deg2rad($firstLatitude)
) * sin(
@kelgendy1204
kelgendy1204 / ab-testing.js
Last active June 2, 2021 15:08
A/B testing 2 different approaches
function createSamples(name, createVariation) {
const sampleCount = 10000;
const variations = [];
for (let i = 0; i < sampleCount; i++) {
variations.push(createVariation());
}
const countData = variations.reduce((accum, curr) => {
if (accum[curr]) {
@mkfares
mkfares / zsh-keyboard-shortucts.md
Last active June 6, 2025 21:16
Common zsh Keyboard Shortcuts on macOS Catalina

Common zsh Keyboard Shortcuts on macOS

Navigation

CTRL + A : Move the cursor to the beginning of the line
CTRL + E : Move the cursor to the end of the line
OPTION + Left Arrow : Move the cursor one word backward
OPTION + Right arrow : Move the cursor one word forward
Left Arrow : Move the cursor one character backward
Right Arrow : Move the cursor one character forward

@szepeviktor
szepeviktor / Wistia-download-videos.md
Last active June 9, 2025 21:00
Download Wistia videos - Please do not misuse it!

Download Wistia videos

  1. right-click on the playing video, select Copy link
  2. find Wistia video ID in the copied link e.g. wvideo=tra6gsm6rl
    • alternative: look for e.g. hashedId=tra6gsm6rl in the page source
  3. load http://fast.wistia.net/embed/iframe/ + video ID in your browser
  4. look for "type":"original" in the page source and copy the URL from the next line e.g. "url":"http://embed.wistia.com/deliveries/129720d1762175bcd8e06dcab926ec76ad38ff00.bin"
  • alternative: look for "type":"hd_mp4_video"
@TheAhmedGad
TheAhmedGad / utf8_arabic_ci.md
Last active August 14, 2024 17:35
Add Arabic utf8 arabic case insensitive Collation to MYSQL ENGINE

Support Arabic CI Collation

To make mysql understand Arabic letters synonyms like "أ" and "إ"

  • Run This to get Collation Path SHOW VARIABLES LIKE 'character_sets_dir';

  • in /collation/path/Index.xml add this to <charset name="utf8"> section