Skip to content

Instantly share code, notes, and snippets.

@leejunkit
leejunkit / gist:310436fb8285a6fefae970988fac159f
Created October 10, 2016 03:08
Use ffmpeg to stitch GoPro timelapse images
ffmpeg -r 15 -start_number 81758 -i G00%03d.JPG -vf "scale=720:-1" -vcodec libx264 -preset veryslow -crf 15 -pix_fmt yuv420p output.mp4
@leejunkit
leejunkit / gist:bc62016b10c580da84e9
Created September 19, 2014 09:08
Use Autolayout to dynamically size UITableViewCells
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return [self heightForBasicCellAtIndexPath:indexPath];
}
- (CGFloat)heightForBasicCellAtIndexPath:(NSIndexPath *)indexPath {
static RWBasicCell *sizingCell = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sizingCell = [self.tableView dequeueReusableCellWithIdentifier:RWBasicCellIdentifier];
});
### Keybase proof
I hereby claim:
* I am leejunkit on github.
* I am kit (https://keybase.io/kit) on keybase.
* I have a public key whose fingerprint is FA91 4A73 0A9A 38E6 A3BB 0C2D CE45 9F14 8D3D 18A9
To claim this, I am signing this object:
# Rip the cd to a single 64kbps AAC-HE v2 file
$ cdparanoia -q 1- - | ffmpeg -i - -c:a libfdk_aac -profile:a aac_he_v2 -b:a 64k output64_2.m4a
# ...or mp3 (with --preset voice)
$ cdparanoia -q 1- - | lame --abr 56 -mm - <output.mp3>
# Concat the resulting m4a files if there is more than one disc
$ ffmpeg -f concat -i <(for f in *.m4a; do echo "file '$(pwd)/$f'"; done) -c copy combined.m4a
# Segment the combined.m4a file for HLS in segment001.aac, segment002.aac etc
@leejunkit
leejunkit / SDWebImage-UITableView stalling crash report
Created July 5, 2013 03:31
Crash log for app stalling when scrolling rapidly up and down UITableView with UITableViewCells containing UIImageViews that are asynchronously downloading images.
Incident Identifier: 0C4071A8-A6CE-498C-B702-8E3A0E67C130
CrashReporter Key: 5cf4602bed1ba84f190bf832db39635487586b8c
Hardware Model: iPhone4,1
Process: Staging [7324]
Path: /var/mobile/Applications/BF16B1D2-0EC5-4D47-93A5-BB5DC8174067/Staging.app/Staging
Identifier: Staging
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
//
// FeedViewController.m
// BurppleShare
//
// Created by Lee Jun Kit on 6/3/13.
// Copyright (c) 2013 Burpple. All rights reserved.
//
#import "FeedViewController.h"
#import "AppDelegate.h"
#import "AppDelegate.h"
#import "Place.h"
#import "FeedViewController.h"
#import "Collection.h"
@implementation AppDelegate
@synthesize managedObjectContext = _managedObjectContext;
@synthesize managedObjectModel = _managedObjectModel;
@synthesize persistentStoreCoordinator = _persistentStoreCoordinator;
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSString *imageURL = @"http://..."; //image URL gotten from Activity object
//get a reference to the image view
UIImageView *imageView = (UIImageView *)[cell viewWithTag:1]; //for example
//using the SDWebImage downloader, start downloading the image
@leejunkit
leejunkit / StringsFileParser.m
Last active December 14, 2015 11:58
In this example, I will localize v3.0 of an app for Traditional Chinese (zh-hant) using an existing zh-hant strings file from v2.9 of the app.
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[])
{
@autoreleasepool {
// load the canonical en strings file -- this can be generated with ibtool
NSDictionary *enStrings = [NSDictionary dictionaryWithContentsOfFile:@"v3.0/en.lproj/MainStoryboard.strings"];
// load a localized strings file from the previous version
@leejunkit
leejunkit / .profile
Created October 15, 2012 15:58
My Bash .profile script for the pretty colored prompts
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
}
#set the sudo bash prompt
export SUDO_PS1="\[\e[0;93;41m\][\u] \w \$\[\e[0m\] "
#set the normal bash prompt
export PS1="\[\e[0;92m\][\u]\[\e[m\] \[\e[0;35m\]\w \[\e[0;96;44m\]\$(parse_git_branch)\[\e[0;32m\]\$\[\e[m\] "