user root admin;
worker_processes 1;
# pid of nginx master process
pid /var/run/nginx.pid;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
''' Place this script at the root of the project directory | |
and enter this for a Run Script during build phase of the helper app | |
${PROJECT_DIR}"/HelperTool_CodeSign_RunScript.py | |
put the run script right after Target Dependencies | |
What this script does is write the SMPrivilegedExecutables dictionary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Uncrustify Configuration File | |
# File Created With UncrustifyX 0.2 (140) | |
# | |
# Alignment | |
# --------- | |
## Alignment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <CoreMedia/CoreMedia.h> | |
#import <CoreVideo/CoreVideo.h> | |
#import <UIKit/UIKit.h> | |
// https://developer.apple.com/library/content/qa/qa1702/_index.html | |
+ (UIImage * _Nullable)imageWithSampleBuffer:(CMSampleBufferRef _Nonnull)sampleBuffer { | |
UIImage *returnValue = nil; | |
CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); | |
CVPixelBufferLockBaseAddress(imageBuffer, 0); { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(UIImage*)mmg_imageScaledToFitSize:(CGSize)fitSize | |
{ | |
// Create a vImage_Buffer from the CGImage | |
CGImageRef sourceRef = self.CGImage; | |
vImage_Buffer srcBuffer; | |
vImage_CGImageFormat format = { | |
.bitsPerComponent = 8, | |
.bitsPerPixel = 32, | |
.colorSpace = NULL, | |
.bitmapInfo = (CGBitmapInfo)kCGImageAlphaFirst, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CVPixelBuffer { | |
func deepcopy() -> CVPixelBuffer? { | |
let width = CVPixelBufferGetWidth(self) | |
let height = CVPixelBufferGetHeight(self) | |
let format = CVPixelBufferGetPixelFormatType(self) | |
var pixelBufferCopyOptional:CVPixelBuffer? | |
CVPixelBufferCreate(nil, width, height, format, nil, &pixelBufferCopyOptional) | |
if let pixelBufferCopy = pixelBufferCopyOptional { | |
CVPixelBufferLockBaseAddress(self, kCVPixelBufferLock_ReadOnly) | |
CVPixelBufferLockBaseAddress(pixelBufferCopy, 0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension UIImage { | |
public func imageRotatedByDegrees(degrees: CGFloat) -> UIImage { | |
let radiansToDegrees: (CGFloat) -> CGFloat = { | |
return $0 * (180.0 / CGFloat(M_PI)) | |
} | |
let degreesToRadians: (CGFloat) -> CGFloat = { | |
return $0 / (180.0 * CGFloat(M_PI)) | |
} | |
// calculate the size of the rotated view's containing box for our drawing space |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@implementation UILabel (SwizzlingExamples) | |
+ (void)load | |
{ | |
SwizzleSelectorWithBlock_Begin(self, @selector(initWithFrame:)) | |
^(UILabel *self, CGRect frame) { | |
if ((self = ((id (*)(id, SEL, CGRect))_imp)(self, _cmd, frame))) { | |
// ... | |
} | |
return self; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# !/bin/bash | |
# Copyright (c) 2011 Float Mobile Learning | |
# http://www.floatlearning.com/ | |
# Extension Copyright (c) 2013 Weptun Gmbh | |
# http://www.weptun.de | |
# | |
# Extended by Ronan O Ciosoig January 2012 | |
# | |
# Extended by Patrick Blitz, April 2013 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension CVPixelBuffer | |
{ | |
/// Deep copy a CVPixelBuffer: | |
/// http://stackoverflow.com/questions/38335365/pulling-data-from-a-cmsamplebuffer-in-order-to-create-a-deep-copy | |
func copy() -> CVPixelBuffer | |
{ | |
precondition(CFGetTypeID(self) == CVPixelBufferGetTypeID(), "copy() cannot be called on a non-CVPixelBuffer") | |
var _copy: CVPixelBuffer? |
OlderNewer