Skip to content

Instantly share code, notes, and snippets.

View xslim's full-sized avatar

Taras Kalapun xslim

View GitHub Profile
.*(networkd\[|locationd\[|SpringBoard\[|cloudd\[|UserEventAgent\[|kernel\[|CLTM\[|nanoregistrylaunchd\[|imagent\[|sharingd\[|backboardd\[|WirelessRadioManagerd\[|mediaserverd\[|launchd\[|AppleHDQGasGauge\[|routined\[|wifid\[|nanoregistryd\[|nfcd\[|assertiond\[|timed\[|identityservicesd\[).*\n
@xslim
xslim / ApplePay.m
Created June 4, 2015 13:32
ApplePay.m
- (void)handlePaymentAuthorizationWithPayment:(PKPayment *)payment completion:(void (^)(PKPaymentAuthorizationStatus))completion {
PKPaymentRequest *paymentRequest = self.paymentRequest;
PKPaymentSummaryItem *totalItem = self.paymentRequest.paymentSummaryItems.lastObject;
if (!totalItem) {
completion(PKPaymentAuthorizationStatusFailure);
return;
}
@xslim
xslim / .clang-format
Created April 28, 2015 11:58
clang-format
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
ConstructorInitializerIndentWidth: 4
AlignEscapedNewlinesLeft: false
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: true
AllowShortIfStatementsOnASingleLine: true
#import <Adyen.h>
@interface ViewController () <ADYLoginDelegate>
@property (nonatomic, weak) IBOutlet UITextView *logView;
@end
@implementation ViewController
- (void)logLine:(NSString *)line {
@xslim
xslim / logging.m
Last active May 28, 2018 07:55
Logging proxy sample
// Simple way
void custom_log_renderer_line(const char *str) {
// or save to file ?
printf("%s\n", str);
}
// OR Advanced way
void custom_log_renderer_linec(const char *component, int level, const char *prefix, const char *str) {
printf("%d %s: %s: %s\n", level, component, prefix, str);
}
@xslim
xslim / TR_GetAdditionalData.m
Last active August 29, 2015 14:16
Examples on working with AdyenToolkit library - Transaction processing
// Asking / getting additional (loyalty) data
- (void)start {
NSMutableDictionary *tenderOptions = [NSMutableDictionary dictionary];
/* an additional call will be made to the back end to connect to a merchant
loyalty system and present data from that loyalty system at an early stage
of transaction processing. The "TransactionProvidesAdditionalData" callback
will be invoked in the ADYTransactionProcessorDelegate.
The same functionality is used to provide a cardalias and will provide the
@xslim
xslim / install.sh
Created February 27, 2015 17:10
Nutch playground
#!/bin/sh
NUTCH_DIST_BIN="http://mirrors.supportex.net/apache/nutch/1.9/apache-nutch-1.9-bin.tar.gz"
cd $OPENSHIFT_DATA_DIR
curl -L ${NUTCH_DIST_BIN} > nutch.tar.gz
tar xvzf nutch.tar.gz
#cd apache-nutch-1.9
@xslim
xslim / runner.sh
Created February 25, 2015 14:53
Nutch config idea
#!/bin/sh
NUTCH_CONF="/runtime/local"
API="http://nutchconf.mrt.io/api"
# Get next Website ID
WS_ID=`curl -L ${API}/website/next`
WS_DEPTH=2
WS_TOPN=50
WS_CRAWL_NAME="TestCrawl"

Keybase proof

I hereby claim:

  • I am xslim on github.
  • I am kalapun (https://keybase.io/kalapun) on keybase.
  • I have a public key whose fingerprint is 7D51 ECB4 062E 1596 4DDB 1511 140D 348B 1033 53A7

To claim this, I am signing this object:

@xslim
xslim / SelectedDeviceManager.h
Last active August 29, 2015 14:16
ADYDevice SelectedDeviceManager
//
// AdyenPOSTerminal
//
// Created by Jeroen Bouma on 12/12/13.
//
#import <Foundation/Foundation.h>
#import "ADYDevice.h"
@interface SelectedDeviceManager : NSObject