Skip to content

Instantly share code, notes, and snippets.

View melbahja's full-sized avatar
🦇
chmod +x bits

Mohamed El Bahja melbahja

🦇
chmod +x bits
View GitHub Profile
@melbahja
melbahja / gist:fe680b36a22c2cb00e6c0e2e22022fdf
Created July 6, 2017 16:02
Safe way to block XSS attacks
<?php
$q = $_GET['query'] ?? null;
if ($q !== null) {
$q = htmlspecialchars(strip_tags($q), ENT_QUOTES, "UTF-8");
}
// data to browser
$data = json_encode(['q' => $q]);
@melbahja
melbahja / README.md
Created January 8, 2019 13:58 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@melbahja
melbahja / file.conf
Created January 14, 2020 21:43
Parse and loop through key value pairs in bash
# this is a comment
MYVAR=My value
OKOK=asas
YES=asja