Skip to content

Instantly share code, notes, and snippets.

View rednebmas's full-sized avatar

Sam Bender rednebmas

View GitHub Profile
@jaydenseric
jaydenseric / ffmpeg-web-video-guide.md
Last active February 17, 2024 23:49
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics

@rsaunders100
rsaunders100 / UIView+ViewArranging.h
Created May 15, 2012 17:39
(iOS) Make a view with given subviews arranged linearly (either horizontally or vertically)
//
// UIView+ViewArranging.h
// Created by on 15/05/2012.
//
#import <UIKit/UIKit.h>
typedef enum {
ViewArrangingDirectionHorizontal,
ViewArrangingDirectionVertical
@mdippery
mdippery / book.m
Created October 28, 2010 18:11
An example of using @dynamic properties in Objective-C
#import <Foundation/Foundation.h>
@interface Book : NSObject
{
NSMutableDictionary *data;
}
@property (retain) NSString *title;
@property (retain) NSString *author;
@end
@landonf
landonf / block-copy.m
Created May 22, 2010 17:38
Demonstrates how -copy and -retain are handled for different block types (stack, heap, global).
/*
* Demonstrates how -copy and -retain are handled for different block types (stack, heap, global).
*/
#import <Foundation/Foundation.h>
/* print a block -description to stdout */
void PrintBlock (NSString *name, id b) {
NSString *str;
str = [NSString stringWithFormat: @"%@ (%@):\n\t-retain\t%@\n\t-copy\t%@\n\n", b, name, [[b retain] autorelease], [[b copy] autorelease]];
@endolith
endolith / frequency_estimator.py
Last active October 30, 2023 18:08
Frequency estimation methods in Python
from __future__ import division
from numpy.fft import rfft
from numpy import argmax, mean, diff, log, nonzero
from scipy.signal import blackmanharris, correlate
from time import time
import sys
try:
import soundfile as sf
except ImportError:
from scikits.audiolab import flacread