Skip to content

Instantly share code, notes, and snippets.

View ohookins's full-sized avatar
🤔
Thinking

Oliver Hookins ohookins

🤔
Thinking
View GitHub Profile
@ohookins
ohookins / gist:5030871
Last active December 14, 2015 04:49
Finding out user limits in Go
package main
import (
"fmt"
"syscall"
)
func main() {
r := syscall.Rlimit{}
@ohookins
ohookins / index.html
Last active December 15, 2015 02:19
Bootstrap part of a SoundCloud embedded player detector.
To add the detect bookmarklet, drag this to your bookmark bar:
<a href="
javascript:(function () {
var script = document.createElement( 'script' );
script.src = '//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js';
script.onload=loadBookmarklet;
document.body.appendChild(script);
function loadBookmarklet() {
@ohookins
ohookins / detect.js
Last active December 15, 2015 02:19
Fingerprints of some common SoundCloud players in order to aid detection of the origin of the player.
var alert_messages = new Array();
// SoundCloud's own SDK wrapping the API
if (window.SC) {
alert_messages.push("SoundCloud Connect SDK (HTTP only)");
}
// HTML5 Widget
var frames = $.find("iframe")
if (frames.length > 0) {
@ohookins
ohookins / gist:5325134
Last active December 15, 2015 21:19
5:05 MP4 with 128kbps AAC audio with standard end of file MOOV atom
Container: MPEG-4 (4937617 bytes)
Box: ftyp
Byte Range: 0-27 (28 bytes)
Box: free
Byte Range: 28-35 (8 bytes)
Box: mdat
Byte Range: 36-4879650 (4879615 bytes)
@ohookins
ohookins / gist:5325136
Last active December 15, 2015 21:19
5:05 MP4 with 128kbps AAC audio with MOOV atom shifted to start of file by qt-faststart
Container: MPEG-4 (4937617 bytes)
Box: ftyp
Byte Range: 0-27 (28 bytes)
Box: moov
Byte Range: 28-57993 (57966 bytes)
Box: mvhd
Byte Range: 36-143 (108 bytes)
Box: trak
Byte Range: 144-57895 (57752 bytes)
@ohookins
ohookins / gist:5325240
Created April 6, 2013 07:14
5:07 Fragmented MP4 with 128kbps AAC audio
Container: MPEG-4 (5066018 bytes)
Box: ftyp
Byte Range: 0-27 (28 bytes)
Box: moov
Byte Range: 28-1165 (1138 bytes)
Box: mvhd
Byte Range: 36-143 (108 bytes)
Box: trak
Byte Range: 144-1027 (884 bytes)
@ohookins
ohookins / gist:5325242
Last active December 15, 2015 21:19
5:05 F4F with 128kbps AAC audio, fragmented by Adobe f4fpackager
Container: MPEG-4 (5979600 bytes)
Box: ftyp
Byte Range: 0-27 (28 bytes)
Box: moov
Byte Range: 28-82304 (82277 bytes)
Box: mvhd
Byte Range: 36-155 (120 bytes)
Box: trak
Byte Range: 156-40678 (40523 bytes)
package main
import "fmt"
type Bar struct {
Name string
}
type Foo struct {
Bar
@ohookins
ohookins / index.template.html
Created October 29, 2013 08:26
Flash test page (IntelliJ generated)
<!-- saved from url=(0014)about:internet -->
<html lang="en">
<!--
Smart developers always View Source.
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.
@ohookins
ohookins / Audiotest.as
Created October 29, 2013 08:31
RTMP test code. Commented sections are generally where the Flash graphical interface used to be, and was replaced with ExternalInterface commands to interact with Javascript functions in the web page.
package {
import flash.display.Sprite;
import flash.events.NetStatusEvent;
import flash.external.ExternalInterface;
import flash.text.*;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.events.SecurityErrorEvent;
import flash.media.SoundTransform;