Skip to content

Instantly share code, notes, and snippets.

View yairsz's full-sized avatar

Yair Szarf yairsz

View GitHub Profile
@yairsz
yairsz / statesDictionary
Created February 2, 2014 20:44
Objective-C method that returns a dictionary of all state names as keys and their abbreviations as values
- (NSDictionary *) stateDictionary {
return @{
@"ALABAMA" : @"AL ",
@"ALASKA" : @"AK ",
@"AMERICAN SAMOA" : @"AS ",
@"ARIZONA" : @"AZ ",
@"ARKANSAS" : @"AR ",
@"CALIFORNIA" : @"CA ",
@"COLORADO" : @"CO ",
@"CONNECTICUT" : @"CT ",
@yairsz
yairsz / videoBites
Created March 13, 2014 02:11
Bash Script to Cut up pieces of video files in a directory using FFMPEG
#!/bin/bash
FILES="/Users/yair/Movies/SoundsOfThePlanets/*.mp4"
#this script creates small pieces of videos out of a directory of .mp4
i=0
for f in $FILES
do
echo "Processing $f file..."
i=`expr $i + 1`
# take action on each file. $f store current file name
@yairsz
yairsz / FFMPEGSnippets.md
Created December 4, 2017 00:42
FFMPEG Snippets

trim a file

ffmpeg -i 2016-10-31-VIDEO-00000282.mp4 -vcodec copy -acodec copy -ss 00:01:19 -t 00:00:45 DeMusicaLigera.mp4

Add a logo overlay

ffmpeg -i DeMusicaLigera.mp4 -i rumberologo.png -filter_complex "[0:v][1:v]overlay=10:10:enable=between(t\,0\,15)” -codec:a copy DeMusicaLigera-96.3000.mp4

@yairsz
yairsz / gist:8be33a817398d69d4d8270c971c317ca
Created October 17, 2018 20:41
print font family names
// List all fonts on iPhone
NSArray *familyNames = [[NSArray alloc] initWithArray:[UIFont familyNames]];
for (NSString *family in familyNames) {
NSLog(@"Family name: %@", family);
NSArray * fontNames = [UIFont fontNamesForFamilyName: family];
for (NSString *font in fontNames) {
NSLog(@" Font name: %@", font);
}
};