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
if (parameters) { | |
if (![mutableRequest valueForHTTPHeaderField:@"Content-Type"]) { | |
NSString *charset = (__bridge NSString *)CFStringConvertEncodingToIANACharSetName(CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding)); | |
[mutableRequest setValue:[NSString stringWithFormat:@"application/json; charset=%@", charset] forHTTPHeaderField:@"Content-Type"]; | |
} | |
[mutableRequest setHTTPBody:[NSJSONSerialization dataWithJSONObject:parameters options:self.writingOptions error:error]]; | |
} |
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
#! /bin/sh | |
# Purging memory if there is less than 20 MB free. | |
# Author: Radosław Szeja | |
# Date: 9.12.2012 | |
while true; do | |
fm=`top -l 1 | awk '/PhysMem/ {print $10}' | sed -e 's/\([0-9]*\)\(M\)/\1/g'`; | |