Skip to content

Instantly share code, notes, and snippets.

View cambiata's full-sized avatar

Jonas Nyström cambiata

View GitHub Profile
@yohhoy
yohhoy / aac_parser.py
Last active March 19, 2025 19:19
Parse AAC/ADTS header
#!/usr/bin/env python3
import sys
import struct
if len(sys.argv) < 2:
print("Usage: aac_parer.py <target.aac>")
exit()
aacfile = open(sys.argv[1], 'rb')
frame_no = 1
@Markavian
Markavian / gist:39f858306cde040e5775
Created October 7, 2014 18:39
Finally... a .htaccess file that routes correctly on my localhost and the server?
DirectoryIndex site/php/routes/index.php?path=index
<IfModule mod_rewrite.c>
Require all granted
RewriteEngine on
RewriteCond %{HTTP_HOST} ^mkv25.net$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^?]*)$ site/php/routes/index.php?path=$1 [NC,L,QSA]
@dpeek
dpeek / FTW.hx
Last active December 10, 2025 03:05
import haxe.macro.Expr;
class FTW
{
public static function build()
{
return haxe.macro.Context.getBuildFields().map(transformField);
}
static function transformField(field:Field)
@dpeek
dpeek / VerEx.hx
Last active May 3, 2019 19:38
VerbalExpressions for Haxe
class VerEx
{
public static function main()
{
var test = new VerEx()
.startOfLine()
.then("http")
.maybe("s")
.then("://")
.maybe("www.")
@cambiata
cambiata / View_Model
Created October 15, 2011 08:07
Simplistic Kohana3 View_Model attempt
<?php
/**
*
* Simplistic View_Model attempt for Kohana 3
* @author Cambiata
*/
class View_Model {
public function render($viewfile=FALSE)
{