In order to profile memory leakage/heap growth in Swift on Linux, you need to a) run it on Linux b) use a profiling tool.
Docker and Valgrind to the rescue.
We're using the official Swift image here: FROM swift:4
.
#!/bin/bash | |
#An Applescript embedded in a shell script so I can do this on the command line. Sorry. | |
#Don't put this on a non retina Mac. Bad Things™ will happen. | |
#by @tomcatterall/@ares (Twitter/App.net). Say something nice to me if you use and like this, I'd love to know. | |
echo 'on run argv | |
try | |
set theDisplayArgument to item 1 of argv as number |
Throughout, let
return_type
be the type of object/primitive/etc. you'd like to return (commonly void
)blockName
be the variable name of the block you're creatingvar_type
be the type object/primitive/etc. you'd like to pass as an argument (leave blank for no parameters)varName
be the variable name of the given parameter And remember that you can create as many parameters as you'd like.Possibly the most common for of declaration.
I hereby claim:
To claim this, I am signing this object:
source.lang.swift.decl.function.free | |
source.lang.swift.ref.function.free | |
source.lang.swift.decl.function.method.instance | |
source.lang.swift.ref.function.method.instance | |
source.lang.swift.decl.function.method.static | |
source.lang.swift.ref.function.method.static | |
source.lang.swift.decl.function.method.class | |
source.lang.swift.ref.function.method.class | |
source.lang.swift.decl.function.accessor.getter | |
source.lang.swift.ref.function.accessor.getter |
@interface LMLPlaintextResponseSerializer : AFHTTPResponseSerializer | |
@end | |
@implementation LMLPlaintextResponseSerializer | |
- (id)responseObjectForResponse:(NSURLResponse *)response data:(NSData *)data error:(NSError *__autoreleasing *)error { | |
[super responseObjectForResponse:response data:data error:error]; //BAD SIDE EFFECTS BAD BUT NECESSARY TO CATCH 500s ETC | |
NSStringEncoding encoding = CFStringConvertEncodingToNSStringEncoding(CFStringConvertIANACharSetNameToEncoding((__bridge CFStringRef)([response textEncodingName] ?: @"utf-8"))); | |
return [[NSString alloc] initWithData:data encoding:encoding]; |
#!!! last updated 11/12/2013. git 1.8.5, BBEdit 10.5, OS 10.9, ruby 2, Xcode 5 !!!#
#Long Operations ##Dropbox and Sync https://www.dropbox.com/downloading
##Homebrew (req for RVM)
ruby -e "$(curl -fsSL https://raw.github.com/mxcl/homebrew/go/install)"
Hi there,
So you want to try out my sweet new change to Cocoapods?
You need to go to a working directory to clone my fork:
git clone https://github.com/swizzlr/CocoaPods.git
and cd CocoaPods
. Then
//Do whatever you want with this except apply a GPL license to it. | |
//credit to @mattt for the below ifndef | |
//make sure you only give it things that respond to "Frame" and return a CGRect | |
@class NSArray; | |
#ifndef NS_ENUM | |
#define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type |