Skip to content

Instantly share code, notes, and snippets.

@april
april / git-log-json.sh
Last active November 4, 2024 22:45
pure shell function for git log as JSON
# attempting to be the most robust solution for outputting git log as JSON,
# using only `git` and the standard shell functions, without requiring
# additional software.
# - uses traditional JSON camelCase
# - includes every major field that git log can output, including the body
# - proper sections for author, committer, and signature
# - multiple date formats (one for reading, ISO for parsing)
# - should properly handle (most? all?) body values, even those that contain
# quotation marks and escaped characters
@dmthomas
dmthomas / Apple Special Event Oct 2020 1080p, 1440p, 2160p
Last active October 21, 2020 21:41
Apple Special Event Oct 2020 1080p, 1440p, 2160p
#h264 1080p
ffmpeg -i https://p-events-delivery.akamaized.net/2109isftrwvmiekgrjkbbhxhfbkxjkoj/vod/avc_1080p_8500/prog_index.m3u8 -c copy "Apple Special Event, October 2020 (1080p) temp.mp4"
ffmpeg -i https://p-events-delivery.akamaized.net/2109isftrwvmiekgrjkbbhxhfbkxjkoj/vod/audio_english_128/prog_index.m3u8 -c copy "Apple Special Event, October 2020 (1080p) temp.aac"
ffmpeg -i "Apple Special Event, October 2020 (1080p) temp.mp4" -i "Apple Special Event, October 2020 (1080p) temp.aac" -c copy "Apple Special Event, October 2020 (1080p).mp4"
#h265 1080p
ffmpeg -i https://p-events-delivery.akamaized.net/2109isftrwvmiekgrjkbbhxhfbkxjkoj/vod/hvc_1080p_7000/prog_index.m3u8 -c copy "Apple Special Event, October 2020 (1080p) temp.mp4"
ffmpeg -i https://p-events-delivery.akamaized.net/2109isftrwvmiekgrjkbbhxhfbkxjkoj/vod/audio_english_128/prog_index.m3u8 -c copy "Apple Special Event, October 2020 (1080p) temp.aac"
ffmpeg -i "Apple Special Event, October 2020 (1080p) temp.mp4" -i "Apple Special Event, October 2020 (1
@camthesaxman
camthesaxman / irixswextract.c
Created March 17, 2018 19:32
tool to extract IRIX software packages
#include <ctype.h>
#include <errno.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
struct Archive
@jpmens
jpmens / codesign.md
Last active April 21, 2023 17:14
Code signing on OS/X to disable pesky "do you want to allow incoming connections" after every damn make

I called my certificate OTrecorderSign

Sign

$ vi *.c
$ make
$ codesign -f -s OTrecorderSign myprog
@lausdahl
lausdahl / git-extract-subdir.md
Last active May 18, 2022 22:02
How to Extract a Subdirectory as a New git Repository
# 1. Clone the remote 
git clone monster-repository project-repository

# 2. change dir
cd project-repository

# 3. Remove the remote
git remote rm origin
@0xced
0xced / uncruftapidiff.m
Created June 18, 2014 22:17
Uncruft iOS 8.0 and OS X 10.10 API diffs
//
// Copyright (c) 2014 Cédric Luthi “0xced”
//
// ./uncruftapidiff https://developer.apple.com/library/prerelease/ios/releasenotes/General/iOS80APIDiffs/index.html iOS8_0APIDiffs.html
// ./uncruftapidiff https://developer.apple.com/library/prerelease/mac/documentation/General/Reference/APIDiffsMacOSX10_10SeedDiff/index.html OSX10_10APIDiffs.html
//
#import <Foundation/Foundation.h>
#import <sysexits.h>
// Playground - noun: a place where people can play
import Cocoa
struct Regex {
let pattern: String
let expressionOptions: NSRegularExpressionOptions
let matchingOptions: NSMatchingOptions
init(pattern: String, expressionOptions: NSRegularExpressionOptions, matchingOptions: NSMatchingOptions) {
@marcoarment
marcoarment / ATPLogoView.m
Created April 29, 2014 21:07
Source for the Accidental Tech Podcast (ATP) T-Shirt
// Source for the Accidental Tech Podcast (ATP) T-Shirt:
// http://www.marco.org/2014/04/29/atp-shirts
//
// By Marco Arment, April 28, 2014. MIT license.
@implementation ATPLogoView
- (void)drawRect:(CGRect)rectIgnored
{
NSString *fontName = @"MyriadPro-Semibold";
@levinunnink
levinunnink / NSImage+Retina.h
Created April 2, 2014 17:02
NSImage retina detection category
//
// NSImage+Retina.h
//
// Created by Levi Nunnink on 3/11/14.
//
#import <Cocoa/Cocoa.h>
@interface NSImage (Retina)
@hsiboy
hsiboy / wiegand.c
Created March 17, 2014 12:59
Wiegand API for Raspberry Pi
/*
* Wiegand API Raspberry Pi
* By Kyle Mallory All rights reserved.
* 12/01/2013
* Based on previous code by Daniel Smith (www.pagemac.com) and Ben Kent (www.pidoorman.com)
* Depends on the wiringPi library by Gordon Henterson: https://projects.drogon.net/raspberry-pi/wiringpi/
*
* This is linked with -lpthread -lwiringPi -lrt
*
* The Wiegand interface has two data lines, DATA0 and DATA1. These lines are normall held