Skip to content

Instantly share code, notes, and snippets.

View gsabran's full-sized avatar

Guillaume Sabran gsabran

View GitHub Profile
@cincodenada
cincodenada / delayspec.pl
Created February 11, 2016 04:19
Gifsicle Speed Changer
use POSIX;
if($#ARGV == -1) { die "No speedup value specified!"; }
$speedup = shift(@ARGV);
while(<>) {
if(/\+ image #(\d+)/) {
$num = $1;
} elsif(/delay ([\d\.]+)s/) {
$delay = POSIX::strtod($1);
$delay /= $speedup;
if($lastdelay && $lastdelay != $delay) {
@jonathan-beebe
jonathan-beebe / hidden_safari_view_controller.swift
Created November 11, 2015 13:16
Use hidden SFSafariViewController
private func showHiddenSafariViewController(controller:SFSafariViewController) {
controller.view.userInteractionEnabled = false
controller.view.alpha = 0.0
self.addChildViewController(controller)
self.view.addSubview(controller.view)
controller.didMoveToParentViewController(self)
controller.view.frame = CGRectZero
}
private func removeHiddenSafariViewController(controller:SFSafariViewController) {
@pburtchaell
pburtchaell / styles.css
Last active February 25, 2024 12:24
VH and VW units can cause issues on iOS devices. To overcome this, create media queries that target the width, height, and orientation of iOS devices.
/**
* VH and VW units can cause issues on iOS devices: http://caniuse.com/#feat=viewport-units
*
* To overcome this, create media queries that target the width, height, and orientation of iOS devices.
* It isn't optimal, but there is really no other way to solve the problem. In this example, I am fixing
* the height of element `.foo` —which is a full width and height cover image.
*
* iOS Resolution Quick Reference: http://www.iosres.com/
*/
@roxlu
roxlu / H264_Decoder.cpp
Created March 3, 2014 16:57
LibAV parser and decoder example with openGL (YUV420 -> RGB shader).
#include "H264_Decoder.h"
H264_Decoder::H264_Decoder(h264_decoder_callback frameCallback, void* user)
:codec(NULL)
,codec_context(NULL)
,parser(NULL)
,fp(NULL)
,frame(0)
,cb_frame(frameCallback)
,cb_user(user)