Skip to content

Instantly share code, notes, and snippets.

View misiek08's full-sized avatar
😁
Hacking for performance and less resources usage!

Michał Idzikowski misiek08

😁
Hacking for performance and less resources usage!
View GitHub Profile
http://foundation.zurb.com/
http://gumbyframework.com/
http://ink.sapo.pt/
http://getbootstrap.com/
http://designmodo.com/demo/flat-ui/
@misiek08
misiek08 / gist:6566480
Created September 14, 2013 23:04
Prism.js with nginx highlighting
/**
* Prism: Lightweight, robust, elegant syntax highlighting
* MIT license http://www.opensource.org/licenses/mit-license.php/
* @author Lea Verou http://lea.verou.me
*/(function(){var e=/\blang(?:uage)?-(?!\*)(\w+)\b/i,t=self.Prism={util:{type:function(e){return Object.prototype.toString.call(e).match(/\[object (\w+)\]/)[1]},clone:function(e){var n=t.util.type(e);switch(n){case"Object":var r={};for(var i in e)e.hasOwnProperty(i)&&(r[i]=t.util.clone(e[i]));return r;case"Array":return e.slice()}return e}},languages:{extend:function(e,n){var r=t.util.clone(t.languages[e]);for(var i in n)r[i]=n[i];return r},insertBefore:function(e,n,r,i){i=i||t.languages;var s=i[e],o={};for(var u in s)if(s.hasOwnProperty(u)){if(u==n)for(var a in r)r.hasOwnProperty(a)&&(o[a]=r[a]);o[u]=s[u]}return i[e]=o},DFS:function(e,n){for(var r in e){n.call(e,r,e[r]);t.util.type(e)==="Object"&&t.languages.DFS(e[r],n)}}},highlightAll:function(e,n){var r=document.querySelectorAll('code[class*="language-"], [class*="language-"] code, code[
SELECT * FROM bought_items bi JOIN items i ON (i.id = bi.item_id) WHERE i.title LIKE %% OR username LIKE %%
@misiek08
misiek08 / gist:7988b3b9a9911e35d0b3
Created August 10, 2014 11:02
PHP class for parsing HTTP multipart/form-data request body
<?php
class HttpMultipartParser
{
public function parse_multipart($stream, $boundary = null)
{
$return = array('variables' => array(), 'files' => array());
$partInfo = null;
@misiek08
misiek08 / gist:90efd270e275732033dc
Created January 25, 2015 16:33
openresty build for debian v2
apt-get install libreadline-dev libncurses5-dev libpcre3-dev libssl-dev perl make libgeoip-dev
./configure --with-http_realip_module --with-http_addition_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_iconv_module -j10 --user=www-data --group=www-data --with-file-aio --with-ipv6
make
make install
@misiek08
misiek08 / gist:fd01946136c149a3e7950a9152fc4fb5
Created October 18, 2017 19:40
basic, incomplete regex for parsing html tag arguments
\b([^\s=]+)=("((?:[^"\\]+(?:\\")?)+)"|'((?:[^'\\]+(?:\\')?)+)')
@misiek08
misiek08 / 0-README.md
Created December 6, 2018 23:40 — forked from Overbryd/0-README.md
Cloudflare Fragment Caching

Cloudflare fragment rendering/caching

This worker script will evaluate your origin response, and replace html comments marked as fragment:key with a respective prefetch defined in a X-Fragments response header.

Usage

Your origin must include the X-Fragments header, specifying the a comma separated list of prefetch requests to make for that response.

< HTTP/1.1 200 OK
@misiek08
misiek08 / ffmpeg.md
Created April 15, 2019 17:40 — forked from dvlden/ffmpeg.md
Convert video files to MP4 through FFMPEG

This is my personal list of functions that I wrote for converting mov files to mp4!

Command Flags

Flag Options Description
-codec:a libfaac, libfdk_aac, libvorbis Audio Codec
-quality best, good, realtime Video Quality
-b:a 128k, 192k, 256k, 320k Audio Bitrate
-codec:v mpeg4, libx264, libvpx-vp9 Video Codec
@misiek08
misiek08 / alternative_input.c
Created February 14, 2024 00:53
ffmpeg alternative input switching from c8e298ab-9614-2cf6-e2c8-0e2729ae5afd@vivanet.hu patch
/*
* Copyright (c) 2018 Bodecs Bela
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*