The popular open-source contract for web professionals by Stuff & Nonsense
- Originally published: 23rd December 2008
- Revised date: March 15th 2016
- Original post
| ffmpeg -i "https://content.jwplatform.com/manifests/Wqyolfwt.m3u8" -c copy -bsf:a aac_adtstoasc video.mp4 | 
| echo 'flush_all' | nc localhost 11211 | |
| # Or... | |
| nc 192.168.1.10 11211<<<"flush_all" | 
| // SIMPLE | |
| // Note: Can convert to UIImage but there's no way to go to CGImage. | |
| CIImage *newImg = [[CIImage imageWithCGImage:img.CGImage] imageByApplyingFilter:@"CIColorMonochrome" | |
| withInputParameters:@{kCIInputColorKey: ciCol}]; | |
| // EXTENDED | |
| CIContext *ctx = [CIContext contextWithOptions:nil]; | |
| CIFilter *filter = [CIFilter filterWithName:@"CIColorMonochrome"]; | 
| // Headers | |
| #import <AudioToolbox/AudioToolbox.h> | |
| void AudioServicesStopSystemSound(SystemSoundID inSystemSoundID); | |
| void AudioServicesPlaySystemSoundWithVibration(SystemSoundID inSystemSoundID,id arg,NSDictionary* vibratePattern); | |
| // Buzz code | |
| NSArray *vibe = @[ @YES, @10 ]; // ON for 10ms | |
| NSDictionary *dict = @{ @"Intensity": @0.1, @"VibePattern": vibe }; | |
| AudioServicesPlaySystemSoundWithVibration(kSystemSoundID_Vibrate,nil,dict); | 
| CGFloat (^modulus)(CGFloat, CGFloat) = ^CGFloat(CGFloat dividend, CGFloat divisor) { | |
| return dividend - floor(dividend / divisor) * divisor; | |
| }; | 
| - (NSIndexPath *)_indexPathByAdding:(NSInteger)N toIndexPath:(NSIndexPath *)idxPath | |
| { | |
| const NSInteger SIZE = 8; | |
| NSInteger item = idxPath.item + N; | |
| NSInteger sectionDelta = trunc(item / SIZE); | |
| item = abs((int)item) % SIZE; | |
| NSInteger section = idxPath.section + sectionDelta; | |
| // MIXINS | |
| + (void)mixInto:(Class)destCls | |
| { | |
| NSAssert([[destCls alloc] isKindOfClass:[UIViewController class]], @"%@ is not a UIViewController subclass", destCls); | |
| void (^inject)(Class, SEL, Class) = ^(Class srcCls, | |
| SEL sel, | |
| Class destcls){ | |
| Method newMethod = class_getInstanceMethod(srcCls, sel); | |
| class_replaceMethod(destCls, sel, method_getImplementation(newMethod), method_getTypeEncoding(newMethod)); // replace is like force-add, where addMethod fails if exists | 
| _alertContainer.alpha = 0.0; | |
| CATransform3D t = CATransform3DIdentity; | |
| t.m34 = -1.0 / 700; | |
| t = CATransform3DRotate(t, -40*M_PI/180., 1.0, 0.0, 0); | |
| t = CATransform3DTranslate(t, 0, -0, -200); | |
| _alertContainer.layer.transform = t; | |
| [UIView | |
| animateWithDuration:self.animDuration | |
| delay:0 | 
| return [NSString stringWithFormat:@"%@ v%@ (%@)", | |
| [[NSBundle mainBundle] infoDictionary][@"CFBundleDisplayName"], | |
| [[NSBundle mainBundle] infoDictionary][@"CFBundleVersion"], | |
| [[NSBundle mainBundle] infoDictionary][@"CFBundleShortVersionString"]]; |