Skip to content

Instantly share code, notes, and snippets.

View alistra's full-sized avatar
🐈

Aleksander Balicki alistra

🐈
View GitHub Profile
#include <emscripten/bind.h>
using namespace emscripten;
using namespace std;
struct Ssss {
char *c;
int x;
};
extension Result: RandomAccessCollection, BidirectionalCollection, Collection, Sequence where Success: RandomAccessCollection, Success.Index == Int {
public typealias Element = Result<Success.Element, Failure>
public typealias Index = Int
public var startIndex: Int {
switch self {
case .success(let array):
return array.startIndex
case .failure:
return 0
}
@alistra
alistra / log.txt
Created November 14, 2017 14:49
Simultaneous accesses to 0x7b2000022890, but modification requires exclusive access.
Simultaneous accesses to 0x7b2000022890, but modification requires exclusive access.
Previous access (a modification) started at ReactiveKit`closure #1 in AtomicObserver.init(disposable:observer:) + 722 (0x109af4492).
Current access (a read) started at:
0 libswiftCore.dylib 0x000000010f3def10 swift_beginAccess + 505
1 ReactiveKit 0x0000000109af48b0 AtomicObserver.on(_:) + 489
2 ReactiveKit 0x0000000109b54cd0 closure #1 in closure #1 in SignalProtocol.start(with:) + 689
3 ReactiveKit 0x0000000109b796f0 partial apply for closure #1 in closure #1 in SignalProtocol.start(with:) + 100
4 ReactiveKit 0x0000000109b81f50 thunk for @callee_owned (@in Event<A, B>) -> () + 72
5 ReactiveKit 0x0000000109b8bf20 partial apply for thunk for @callee_owned (@in Event<A, B>) -> () + 136
@alistra
alistra / gist:fbcaac8f2472a87de229
Created June 13, 2015 08:36
pip install pytz on OS X 10.11
pip pytz
The directory '/Users/alistra/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/alistra/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
/Library/Python/2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Collecting pytz
Downloading pytz-2015.4-py2.py3-none-any.whl (475kB)
100% |████████████████████
@alistra
alistra / -
Created January 20, 2017 14:24
-----BEGIN RSA PRIVATE KEY-----
MIIcmwIBAAKCBlMbyooEaYo7HtWo0JDfLNecywEYT5V4yhgFx9a58af8LAYmwRMe
nlO1ukxf+y7VDaqRpemS+96LC0a2Qz+LDbOhfc8OsWw8HYrYVQXhlVUgoECOcxVu
RMGsghtnit2xNLjF24spTYz6BCcv7qdHiVue0JVgVnS+BztvYTGJBw1fjsVHf0TC
xGXZcELjfOtvHcYgUndFm/4QsJjwxYMRamArGIX5jQ73cqlOmoZWKE1twLctfXp8
+8ic/SPFnCe1+PLKpm+9SaE8NQJqAwCrF7Tmev1BPunwv+wNkKArU3xtpou/Rcsi
OUOHAgeBb8LoS2ulEav1LtXrfjqHICRTDJF6i0MsrknUBpJjCwbR2D+mpC6iT2Ap
1F6H9vxnfmOOS6OfEmQHmtU97nycAFZ6dFcSAzFHDiXqB7FPosoFQs8lcncBNhGe
1yCN1Z3DZclwQmFoTXX3/Fl11jvS4pFqIXctvPJPl+7ZtzNnnE8Xz3in6j8PYeVc
lkZvyRTN0Ty6GYIQRFkTCLeM3hKGJ1HqTB9u/S/7SKfPJE8uMZpVOoQtVRaHIS/7
@alistra
alistra / -
Created January 20, 2017 14:24
-----BEGIN RSA PRIVATE KEY-----
MIIcmwIBAAKCBlMbyooEaYo7HtWo0JDfLNecywEYT5V4yhgFx9a58af8LAYmwRMe
nlO1ukxf+y7VDaqRpemS+96LC0a2Qz+LDbOhfc8OsWw8HYrYVQXhlVUgoECOcxVu
RMGsghtnit2xNLjF24spTYz6BCcv7qdHiVue0JVgVnS+BztvYTGJBw1fjsVHf0TC
xGXZcELjfOtvHcYgUndFm/4QsJjwxYMRamArGIX5jQ73cqlOmoZWKE1twLctfXp8
+8ic/SPFnCe1+PLKpm+9SaE8NQJqAwCrF7Tmev1BPunwv+wNkKArU3xtpou/Rcsi
OUOHAgeBb8LoS2ulEav1LtXrfjqHICRTDJF6i0MsrknUBpJjCwbR2D+mpC6iT2Ap
1F6H9vxnfmOOS6OfEmQHmtU97nycAFZ6dFcSAzFHDiXqB7FPosoFQs8lcncBNhGe
1yCN1Z3DZclwQmFoTXX3/Fl11jvS4pFqIXctvPJPl+7ZtzNnnE8Xz3in6j8PYeVc
lkZvyRTN0Ty6GYIQRFkTCLeM3hKGJ1HqTB9u/S/7SKfPJE8uMZpVOoQtVRaHIS/7
@alistra
alistra / -
Created October 20, 2016 15:02
; <<>> DiG 9.8.3-P1 <<>> jasminek.net
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 60428
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
;; QUESTION SECTION:
;jasminek.net. IN A
;; ANSWER SECTION:

Keybase proof

I hereby claim:

  • I am alistra on github.
  • I am alistra (https://keybase.io/alistra) on keybase.
  • I have a public key whose fingerprint is 3B0D 716D 7636 80BC 72E2 A522 E3D2 CAD6 A16E DE5B

To claim this, I am signing this object:

CGRect CGRectIntegralScaledEx(CGRect rect, CGFloat scale)
{
return CGRectMake(floorf(rect.origin.x * scale) / scale, floorf(rect.origin.y * scale) / scale, ceilf(rect.size.width * scale) / scale, ceilf(rect.size.height * scale) / scale);
}
CGRect CGRectIntegralScaled(CGRect rect)
{
return CGRectIntegralScaledEx(rect, [[UIScreen mainScreen] scale]);
}
NSMutableArray *operations = [NSMutableArray array];
[self.puppets.copy enumerateObjectsUsingBlock:^(AnswerKeyPuppet *checkedPuppet,
NSUInteger idx,
BOOL *stop) {
[self.puppets.copy enumerateObjectsUsingBlock:^(AnswerKeyPuppet *puppet,
NSUInteger idx2,
BOOL *stop2) {