Skip to content

Instantly share code, notes, and snippets.

View MaximKeegan's full-sized avatar

Maxim Keegan MaximKeegan

  • Tochka Bank
  • Yekaterinburg, Russia
View GitHub Profile
//
// RoundedCornersTextView.h
//
// Created by Maxim Keegan on 03.06.15.
// Copyright (c) 2015 Keegan. All rights reserved.
//
#import <UIKit/UIKit.h>
IB_DESIGNABLE
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7e2fae00 of class UICollectionView was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x7c743ff0> (
<NSKeyValueObservance 0x7c7416b0: Observer: 0x0, Key path: contentOffset, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x7c203280>
<NSKeyValueObservance 0x7c7416f0: Observer: 0x0, Key path: contentSize, Options: <New: YES, Old: NO, Prior: NO> Context: 0x0, Property: 0x7c203990>
)'
*** First throw call stack:
(
0 CoreFoundation 0x0475f946 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x043e4a97 objc_exception_throw + 44
2 CoreFoundation 0x0475f86d +[NSException raise:format:] + 141
3 Foundation 0x023136d4 NSKVODeallocate + 379
//
// JSONValueTransformer+LocationTransformer.h
// Geomonopoly
//
// Created by Maxim Keegan on 26/08/14.
//
#import "JSONValueTransformer.h"
@interface JSONValueTransformer (LocationTransformer)
[[[MKSessionManager sharedManager] activeSession] POST:@"controller/method" parameters:params success:^(NSURLSessionDataTask *task, id responseObject) {
DLog(@"Resp %@", [task response]);
NSLog(@"JSON: %@", responseObject);
} failure:^(NSURLSessionDataTask *task, NSError *error) {
NSLog(@"Error: %@", error);
}];
- (IBAction)twitterButtonAction:(id)sender {
ACAccountStore *accountStore = [[ACAccountStore alloc] init];
ACAccountType *accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError *error) {
if (granted) {
NSArray *accountsArray = [accountStore accountsWithAccountType:accountType];
if ([accountsArray count] > 0) {
ACAccount *twitterAccount = [accountsArray lastObject];
DLog(@"%@ %@", twitterAccount.identifier, twitterAccount.username);
RIButtonItem *cancelItem = [RIButtonItem item];
cancelItem.label = NSLocalizedString(@"Cancel",@"Cancel");
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"Subscribe", @"Subscribe")
message:nil
cancelButtonItem:cancelItem
otherButtonItems:nil];
for (DPSProduct *dpsProduct in productsSet) {
RIButtonItem *purchaseItem = [RIButtonItem item];
Все плохо:
mtr -w -r -c 10 195.58.9.105
HOST: mail.east-media.ru                       Loss%   Snt   Last   Avg  Best  Wrst StDev
 1.|-- cz-eth0205-gw-86.host-telecom.com        60.0%    10    2.8   3.8   2.8   5.6   1.3
 2.|-- cz-gw-core.host-telecom.com               0.0%    10    1.5  14.5   0.3 136.5  42.9
 3.|-- gi4-43.mag01.prg01.atlas.cogentco.com     0.0%    10    2.7   3.8   2.7  12.8   3.2
 4.|-- te3-3.ccr01.prg01.atlas.cogentco.com      0.0%    10    4.2   2.9   2.6   4.2   0.5
 5.|-- te3-8.ccr01.brq01.atlas.cogentco.com      0.0%    10    7.5   6.5   6.0   8.5   0.8
 6.|-- te0-2-0-7.ccr22.bts01.atlas.cogentco.com  0.0%    10    8.6   9.6   8.6  15.2   2.0
 7.|-- te0-1-0-1.ccr21.vie01.atlas.cogentco.com  0.0%    10   10.1  10.5   9.9  12.2   0.7
BOOL GSFontAddFromFile(const char * path);
NSUInteger newFontCount = 0;
NSBundle *frameworkBundle = [NSBundle bundleWithIdentifier:@"com.apple.GraphicsServices"];
const char *frameworkPath = [[frameworkBundle executablePath] UTF8String];
if (frameworkPath) {
void *graphicsServices = dlopen(frameworkPath, RTLD_NOLOAD | RTLD_LAZY);
if (graphicsServices) {
BOOL (*GSFontAddFromFile)(const char *) = dlsym(graphicsServices, "GSFontAddFromFile");
if (GSFontAddFromFile) {
for (NSString *fontFile in [[NSBundle mainBundle] pathsForResourcesOfType:@"otf" inDirectory:nil])
mysql> select * from edetailing_actions;
+------+---------------------+-------------+------------+
| id | name | description | bundles_id |
+------+---------------------+-------------+------------+
| 1 | open_intro | | 16 |
| 2 | start_app | | 4 |
| 3 | first_start | | 4 |
| 4 | open_kiosk | | 16 |
| 5 | open_carousel | | 16 |
| 6 | open_book10 | | 16 |
<?php
$path_node = explode("?", substr($_SERVER["REQUEST_URI"],count(dirname($_SERVER["PHP_SELF"]))));
$path_node = urldecode($path_node[0]);
$path_chains = explode("/", $path_node);
function fucking_drupal_cant_load_node_by_url($path_node) {
// такой изподвыпердный изврат для получения PATH_INFO требуетя из-за разных настроек серверов
$query = "SELECT src FROM {url_alias} WHERE dst = '%s';";
// fuckig php have't closure!
$_result = db_query($query, $path_node);