...like it Windows Explorer does.
JavaScript code:
/**
* Formats bytes mostly like Windows does,
* but in some rare cases the result is different.| import Foundation | |
| public class Storage { | |
| fileprivate init() { } | |
| enum Directory { | |
| // Only documents and other data that is user-generated, or that cannot otherwise be recreated by your application, should be stored in the <Application_Home>/Documents directory and will be automatically backed up by iCloud. | |
| case documents | |
| import java.nio.ByteBuffer; | |
| import java.util.UUID; | |
| public class UuidAdapter { | |
| public static byte[] getBytesFromUUID(UUID uuid) { | |
| ByteBuffer bb = ByteBuffer.wrap(new byte[16]); | |
| bb.putLong(uuid.getMostSignificantBits()); | |
| bb.putLong(uuid.getLeastSignificantBits()); | |
| return bb.array(); |
| #!/bin/sh | |
| # To the extent possible under law, Viktor Szakats | |
| # has waived all copyright and related or neighboring rights to this | |
| # script. | |
| # CC0 - https://creativecommons.org/publicdomain/zero/1.0/ | |
| # SPDX-License-Identifier: CC0-1.0 | |
| # THIS SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| Sprite *createBlankSprite(const Color4B& color, Size size) | |
| { | |
| GLubyte *buffer = (GLubyte *)malloc(sizeof(GLubyte)*4); | |
| buffer[0] = color.r; | |
| buffer[1] = color.g; | |
| buffer[2] = color.b; | |
| buffer[3] = color.a; | |
| auto tex = new Texture2D(); | |
| tex->initWithData(buffer, sizeof(GLubyte)*4, Texture2D::PixelFormat::RGBA8888, 1, 1, size); |
| # post_loc.txt contains the json you want to post | |
| # -p means to POST it | |
| # -H adds an Auth header (could be Basic or Token) | |
| # -T sets the Content-Type | |
| # -c is concurrent clients | |
| # -n is the number of requests to run in the test | |
| ab -p post_loc.txt -T application/json -H 'Authorization: Token abcd1234' -c 10 -n 2000 http://example.com/api/v1/locations/ |
| // | |
| // NSError+NoConnection.h | |
| // | |
| // Created by Maurizio Cremaschi on 01/11/2013. | |
| // Copyright (c) 2013 Myfleek Ltd. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| @interface NSError (NoConnection) |
Generate the list yourself:
$ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS*.sdk/System/Library/Frameworks/UIKit.framework/Headers
$ grep UI_APPEARANCE_SELECTOR ./* | \
sed 's/NS_AVAILABLE_IOS(.*)//g' | \
sed 's/NS_DEPRECATED_IOS(.*)//g' | \
sed 's/API_AVAILABLE(.*)//g' | \
sed 's/API_UNAVAILABLE(.*)//g' | \
sed 's/UI_APPEARANCE_SELECTOR//g' | \