Skip to content

Instantly share code, notes, and snippets.

View sethmills21's full-sized avatar

Seth Miller sethmills21

View GitHub Profile
@omarojo
omarojo / imageToPixelBuffer.m
Last active July 11, 2022 08:57
Image to CVPixelBuffer OBJC
let myPixelBuffy = [self pixelBufferFromCGImage:[[UIImage imageNamed:@"myImage.png"] CGImage]];
- (CVPixelBufferRef)pixelBufferFromCGImage:(CGImageRef)image
{
CGSize frameSize = CGSizeMake(CGImageGetWidth(image), CGImageGetHeight(image));
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey,
[NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey,
nil];
@akesson
akesson / iOSUIImageArray2Video.swift
Last active August 31, 2022 12:45
[iOS] UIImage array 2 Video
//http://stackoverflow.com/questions/3741323/how-do-i-export-uiimage-array-as-a-movie/3742212#3742212
import AVFoundation
import UIKit
import Photos
struct RenderSettings {
var width: CGFloat = 1334
var height: CGFloat = 750
@at-daonguyen
at-daonguyen / Podfile
Created June 30, 2016 03:45
Disable BITCODE for all Pods
source 'https://github.com/CocoaPods/Specs.git'
inhibit_all_warnings!
platform :ios, '8.0'
use_frameworks!
target 'Example' do
# frameworks
end
# BITCODE bug fix
@wuyongrui
wuyongrui / renderSepiaEffectIntoAsset.swift
Created March 22, 2016 10:02
renderSepiaEffectIntoAsset
// https://osxentwicklerforum.de/index.php/Thread/24626-AVFoundation-CALayer/
-(void)renderSepiaEffectIntoAsset:(AVAsset*)asset withOnCompletion:(void(^)(NSURL* fileURL))aBlock{
CALayer* sepiaLayer = [CALayer layer];
sepiaLayer.frame = CGRectMake(20, 20, 320,480);
CIFilter *myFilter = [CIFilter filterWithName:@"CISepiaTone"];
[myFilter setDefaults];
[myFilter setValue:[NSNumber numberWithFloat:0.8f] forKey:@"inputIntensity"];
@rayfix
rayfix / fiindsize.swift
Created February 7, 2016 05:30
Getting the Size of a file or directory in Swift
//
// main.swift
// findsize
//
// Created by Ray Fix on 2/6/16.
// Copyright © 2016 Neko Labs. All rights reserved.
//
import Foundation
@gokulkrishh
gokulkrishh / media-query.css
Last active July 12, 2025 23:39
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@michelem09
michelem09 / node-async-mongodb-multiple-updates.js
Last active August 8, 2022 07:49
Gist to update several items in series in a huge MongoDB collection (millions of records) with Node.js and Async module
'use strict';
/**
* Module dependencies.
*/
var async = require('async'),
mongoose = require('mongoose'),
ObjectId = mongoose.Types.ObjectId;
var db = mongoose.connect('mongodb://localhost:27017/test', {}, function (err) {
@steipete
steipete / FilterScriptPhase.sh
Created April 27, 2015 16:25
This filter script phase is required to remove unused architectures from your application, which would be flagged as issue during upload to the Apple AppStore. Read more at http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/
APP_PATH="${TARGET_BUILD_DIR}/${WRAPPER_NAME}"
# This script loops through the frameworks embedded in the application and
# removes unused architectures.
find "$APP_PATH" -name '*.framework' -type d | while read -r FRAMEWORK
do
FRAMEWORK_EXECUTABLE_NAME=$(defaults read "$FRAMEWORK/Info.plist" CFBundleExecutable)
FRAMEWORK_EXECUTABLE_PATH="$FRAMEWORK/$FRAMEWORK_EXECUTABLE_NAME"
echo "Executable is $FRAMEWORK_EXECUTABLE_PATH"
@pkh
pkh / gist:c2e44eb6a11d62b83977
Last active October 5, 2020 13:18
Helpful method to dismiss ALL view controllers presented on top of a root view/navigation controller.
/**
Helpful method to dismiss ALL view controllers presented on top of a
root view/navigation controller.
This method is useful if you have a variable number of view controllers
that you'd need to dimiss to return to a base view. Used for my purposes
from the AppDelegate class during the process of handling the opening of
a URL scheme.
This method also relies on implementing a category on UIViewController
@jmsaavedra
jmsaavedra / ffmpeg_install.md
Last active June 7, 2024 17:33
Install FFmpeg on a Linux Box

Install FFmpeg via CLI on Linux box

These steps walk through installing a static binary of any ffmpeg version on to your linux machine. If you want to compile from source, there are several ways to do so. Here's the official guide. Tested and works on an AWS EC2 Ubuntu instance, but should work on any Linux machine.

  • SSH into your instance and become root