This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# fetch the smallest possible head of an MP3 to list chapters (HH:MM:SS) | |
# deps: curl, ffprobe (ffmpeg), jq, column, awk | |
set -euo pipefail | |
usage() { | |
cat <<EOF | |
Usage: $0 <mp3_url> [--json] [--max-mb N] [--quiet] | |
--json Output chapters as JSON (seconds), not a table | |
--max-mb N Stop after N megabytes (default: 32) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/paypal/gatt" | |
"github.com/paypal/gatt/examples/option" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\documentclass[10pt,parskip=full,a4paper]{article} | |
\pagestyle{empty} | |
\usepackage[top=2.5cm,left=1cm,right=1cm]{geometry} | |
\usepackage{csvtools} | |
\usepackage{lmodern} | |
\renewcommand*\familydefault{\sfdefault} | |
\usepackage[T1]{fontenc} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSUInteger DeviceSystemMajorVersion(); | |
NSUInteger DeviceSystemMajorVersion() { | |
static NSUInteger _deviceSystemMajorVersion = -1; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_deviceSystemMajorVersion = [[[[[UIDevice currentDevice] systemVersion] componentsSeparatedByString:@"."] objectAtIndex:0] intValue]; | |
}); | |
return _deviceSystemMajorVersion; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function verifyPurchase($transactionid, $productid, $uuid, $sandbox=false) { | |
$body = @file_get_contents('php://input'); | |
//encode receipt | |
$body = base64_encode($body); | |
$receipt = json_encode(array("receipt-data" => $body)); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (BOOL)application:(NSApplication*)app openFile:(NSString*)file{ | |
NSData *data = [[NSData alloc] initWithContentsOfFile:file]; | |
NSString *query = @"/sesx/session/xmpMetadata"; | |
NSArray *result = PerformXMLXPathQuery(data, query); | |
NSString *xmpQuery = @"/x:xmpmeta/rdf:RDF/rdf:Description/xmpDM:Tracks/rdf:Bag/rdf:li/xmpDM:markers/rdf:Seq"; | |
NSString *xmpMetadataString = [[[[result objectAtIndex:0] objectForKey:@"nodeChildArray"] objectAtIndex:0] objectForKey:@"nodeContent"]; | |
NSData *xmpMetadataData = [xmpMetadataString dataUsingEncoding:NSUTF8StringEncoding]; |