Skip to content

Instantly share code, notes, and snippets.

View nevyn's full-sized avatar

Nevyn Bengtsson nevyn

View GitHub Profile
#include <Cartridge.h>
uint8_t smb2_overworld[] = {
0x56, 0x67, 0x6D, 0x20, 0x5B, 0x69, 0x00, 0x00, 0x61, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x47, 0x68, 0x00, 0x00, 0x17, 0xD9, 0x21, 0x00, 0xDF, 0x12, 0x00, 0x00, 0x20, 0xCC, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x8C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x4F, 0x1B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
pod 'Lookback'
@nevyn
nevyn / LookbackParticipate.h
Created February 4, 2017 00:01
Participate 1.9.0.2
#import <UIKit/UIKit.h>
@protocol LookbackParticipateDelegate;
NS_ASSUME_NONNULL_BEGIN
/*! @header LookbackParticipate.h
@abstract
Public interface for Lookback Participate, the friendly UX for guiding test particioants
through a research session, be it live, self-guided or in person.
@nevyn
nevyn / LookbackParticipate.h
Created February 3, 2017 07:53
Lookback 1.8.0.1 SDK Beta
#import <UIKit/UIKit.h>
@protocol LookbackParticipateDelegate;
NS_ASSUME_NONNULL_BEGIN
/*! @header LookbackParticipate.h
@abstract
Public interface for Lookback Participate, the friendly UX for guiding test particioants
through a research session, be it live, self-guided or in person.
LBNotificationBanner *banner = [LBNotificationBanner new];
[overlay addSubview:banner];
banner.translatesAutoresizingMaskIntoConstraints = NO;
LBInstallConstraint(banner, Top, Equal, overlay, Top, 1, margin);
LBInstallConstraint(banner, Left, Equal, overlay, Left, 1, margin);
LBInstallConstraint(banner, Right, Equal, overlay, Right, 1, margin);
#define LBGuard(cond, ...) \
BOOL __COND_SUCCESSFUL_AT ## __LINE__ = (cond); \
if(!__COND_SUCCESSFUL_AT ## __LINE__) {\
NSString *failureReason = [NSString stringWithFormat:__VA_ARGS__]; \
NSAssert(NO, @"Guard failed: %@: %@", @#cond, failureReason); \
NSLog(@"Guard failed: %@: %@", @#cond, failureReason);\
} \
if(__COND_SUCCESSFUL_AT ## __LINE__) {}
- (void)appendEncodedSampleBuffer:(CMSampleBufferRef)encodedSampleBuffer addTrimAtStart:(int)trimDuration fromSource:(id)source
{
if(!_hasWrittenTrim) {
GFLog(GFDebug, @"Adding trim to sample buffer from %@", source);
const AudioStreamBasicDescription *asbd = CMAudioFormatDescriptionGetStreamBasicDescription(CMSampleBufferGetFormatDescription(encodedSampleBuffer));
CMSetAttachment(encodedSampleBuffer, kCMSampleBufferAttachmentKey_TrimDurationAtStart, (id)CFAutorelease(
CMTimeCopyAsDictionary(
CMTimeMake(trimDuration, asbd->mSampleRate),
kCFAllocatorDefault
@nevyn
nevyn / LBCompositionDebugger.h
Last active July 18, 2017 17:42
Debug AVVideoCompositions using Apple's sample code, without having to find space *in your app* for its debug UI. I'm not sure what the correct way to license this is, but you're free to use it as you see fit as long as it conforms to Apple's original license :)
//
// LBCompositionDebugger.h
// LBMergeVideo
//
// Created by nevyn Bengtsson on 2016-02-19.
// Copyright © 2016 Lookback. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreMedia/CoreMedia.h>
(lldb) po _webView
<WKWebView: 0x6080001a24c0>
(lldb) po [_webView subviews]
<__NSArrayM 0x6000002426a0>(
<WKView: 0x608000140bb0>
)
(lldb) po [[[_webView subviews] firstObject] subviews]
@nevyn
nevyn / GFGetVersion.h
Last active January 13, 2016 19:15
Git version into info.plist. Add GenerateGFVersion.sh as a build step first in your build process.
#import <Foundation/Foundation.h>
/// Retrieve version number of this library, roughly as outputted by git describe
extern NSString *GFGetVersion(void);