Skip to content

Instantly share code, notes, and snippets.

View azihassan's full-sized avatar
🦆

Azi Hassan azihassan

🦆
View GitHub Profile
@azihassan
azihassan / split.py
Created November 10, 2026 01:48
Splits a video file by black screens
import subprocess
import re
import sys
import os
from itertools import batched
def main(argv):
if len(argv) == 1:
print('Usage: python split.py <video.mp4>')
sys.exit(1)
@azihassan
azihassan / video-blackdetect-seekbar.html
Last active November 10, 2026 00:16
Video seek bar with black-frame markers, generated by Claude, with slight manual modifications
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Video Black-Screen Seek Bar</title>
<style>
:root {
--bg: #111;
--panel: #1c1c1c;
@azihassan
azihassan / win-forfait.php
Last active October 6, 2026 00:19
PHP win by inwi balance verification script
<?php
$subscriptionId = 'XXXXXXXXXXXXXXXXXX';
$login = in_array('--login', $argv);
if($login)
{
if(!in_array('--username', $argv) || !in_array('--password', $argv))
{
echo "Usage: php {$argv[0]} --login --username <username> --password <password>\n";
exit(1);
@azihassan
azihassan / clx.cpp
Last active January 24, 2025 00:19
Removes all groups from a CLX animation file except the first
#include <cassert>
#include <numeric>
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <functional>
#include <cstdint>
uint16_t readLittleEndianWord(std::ifstream& stream)
@azihassan
azihassan / zhangsuen.cpp
Created March 7, 2018 00:22
Zhang-Suen thinning algorithm
#include <iostream>
#include <vector>
using namespace std;
struct Point
{
size_t x;
size_t y;
Point() : x(0), y(0) {}
#include <SoftwareSerial.h>
#include "SIM900.h"
bool gprs_active;
char incoming[255] = "";
bool handling_call;
void setup()
{
handling_call = false;
#include <iostream>
#include <vector>
#include <SFML/Graphics.hpp>
class Scroller
{
sf::Texture texture;
sf::IntRect rect;
public:
Scroller(sf::Texture& texture)
#include <iostream>
#include <algorithm>
#include <array>
#include <utility>
#include <map>
#include <vector>
#include <queue>
struct Point
{
@azihassan
azihassan / xml.php
Created December 16, 2015 15:59
SimpleXML usage example
<form method = "post">
<p><label>Nom : <input type = "text" name = "nom" /></label></p>
<p><label>Prenom : <input type = "text" name = "prenom" /></label></p>
<p><label>CIN : <input type = "text" name = "cin" /></label></p>
<p><label>Adresse : <input type = "text" name = "adresse" /></label></p>
<p><label>Email : <input type = "text" name = "email" /></label></p>
<p><input type = "submit" value = "Convertir" /></p>
</form>
<?php
@azihassan
azihassan / filecomp.php
Last active December 14, 2015 19:33
Memory-friendly function that compares two files and returns a boolean
<?php
if(compare_files('file1', 'file2'))
echo 'Files are similar', PHP_EOL;
else
echo 'Files are different', PHP_EOL;
function compare_files($a, $b, $buf_size = 1048576)
{
if($a === $b)
return true;