Skip to content

Instantly share code, notes, and snippets.

View xslim's full-sized avatar

Taras Kalapun xslim

View GitHub Profile
@xslim
xslim / AdyenPOSTransactionRecoveryIdea.m
Last active December 18, 2018 14:44
AdyenPOS check complete or refund
// Adyen Delegates
-(void)transactionStarted:(ADYTransactionData *)transaction {
// Save tenderReference and terminalId to storage
NSUserDefaults *ud = [NSUserDefaults standardUserDefaults];
[ud setObject:transaction.tenderReference forKey:@"tx_tenderReference"];
[ud setObject:transaction.terminalId forKey:@"tx_terminalId"];
[ud synchronize];
}
@xslim
xslim / VirtualBox.md
Created December 13, 2018 10:36
VirtualBox things

Win10

Mac screen resolution

  • 2560x1600

  • 1280x800

  • VBoxManage modifyvm "Win10" --vram 256

  • VBoxManage getextradata "Win10" enumerate

  • VBoxManage setextradata "Win10" CustomVideoMode1 1920x1200x32

-(void)removeAllPaymentDevices:(id)args
{
NSLog(@"removing all payment devices");
ADYDeviceRegistry* deviceRegistry = [Adyen sharedInstance].deviceRegistry;
NSMutableArray* devices = deviceRegistry.devices.copy;
for (ADYDevice* device in devices) {
if (device.connectionType == ADYDeviceConnectionTypeWifi && device.hostname != nil && ![device.hostname isEqualToString:@""]) {
#!/bin/bash
POIID=YOUR_TERMINAL_SERIAL_NUMBER
url=https://terminal-api-test.adyen.com/sync
apikey="YOUR_CHECKOUT_API_KEY"
SaleID="${USER}-${HOSTNAME}"
ServiceID=$(date +%m%d%H%M%S)
TransactionID=$RANDOM
TimeStamp=$(date -u +%FT%T+00:00)
@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);
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">

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 3E8B 6BA3 7DA6 0C04 A12D 0298 369A FECC D6DD 12C0

To claim this, I am signing this object:

@xslim
xslim / Rakefile
Created May 13, 2013 12:41
Rakefile for iOS builds
require 'xcoder'
# gem install specific_install
# gem specific_install -l https://github.com/xslim/xcoder.git
#xcoder -l notice -r build
#xcoder -l notice -r package
#xcoder -l notice -r deploy
# Define or comment out
@xslim
xslim / menu.py
Created October 31, 2017 12:55
Python Menu 1
class Menu(object):
def __init__(self, title=None, options=None, message=None,
refresh=lambda: None, println=lambda: None, printend=lambda: None,
clear=lambda: None, iinput=lambda: None):
if options is None:
options = []
self.options = None
self.title = None
self.is_title_enabled = None