This file contains hidden or 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
| ACTION | |
| AD_HOC_CODE_SIGNING_ALLOWED | |
| ALTERNATE_GROUP | |
| ALTERNATE_MODE | |
| ALTERNATE_OWNER | |
| ALWAYS_SEARCH_USER_PATHS | |
| ALWAYS_USE_SEPARATE_HEADERMAPS | |
| APPLE_INTERNAL_DEVELOPER_DIR | |
| APPLE_INTERNAL_DIR | |
| APPLE_INTERNAL_DOCUMENTATION_DIR |
This file contains hidden or 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
| // | |
| // RSTimingFunction.h | |
| // | |
| // Created by Raphael Schaad on 2013-09-28. | |
| // This is free and unencumbered software released into the public domain. | |
| // | |
| #import <UIKit/UIKit.h> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
| git config --global https.proxy http://127.0.0.1:1080 | |
| git config --global https.proxy https://127.0.0.1:1080 | |
| git config --global --unset http.proxy | |
| git config --global --unset https.proxy | |
| npm config delete proxy |
This file contains hidden or 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 hidden or 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
| CVImageBufferRef imageBuffer = CMSampleBufferGetImageBuffer(sampleBuffer); | |
| CVPixelBufferLockBaseAddress(imageBuffer,0); | |
| size_t height = CVPixelBufferGetHeight(imageBuffer); | |
| size_t width = CVPixelBufferGetWidth(imageBuffer); | |
| size_t bytesPerRow = CVPixelBufferGetBytesPerRow(imageBuffer); | |
| void *sourceData = CVPixelBufferGetBaseAddress(imageBuffer); | |
| // Set a bunch of variables we need. The "radius" for the blur kernel needs to be positive and odd. The permute map maps the BGRA channels of the buffer to the ARGB that vImage needs. |
This file contains hidden or 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 hidden or 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? |