Skip to content

Instantly share code, notes, and snippets.

@ademcan
ademcan / 0_reuse_code.js
Created January 8, 2016 14:30
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console

Keybase proof

I hereby claim:

  • I am ademcan on github.
  • I am ademcan (https://keybase.io/ademcan) on keybase.
  • I have a public key whose fingerprint is FA55 40F1 A75D 5280 9BFB D5C2 250E 9948 2407 6FEA

To claim this, I am signing this object:

> RNMainchainDemo@0.0.1 test /Users/abilican/Documents/projects/perso/elastos/react-native-elastos-wallet-core-demo
> wdio config/wdio.ios.app.conf.js
2019-05-01T06:46:05.207Z DEBUG @wdio/utils:initialiseServices: initialise wdio service "appium"
2019-05-01T06:46:05.224Z INFO @wdio/cli:Launcher: Run onPrepare hook
2019-05-01T06:46:05.227Z DEBUG @wdio/appium-service: Will spawn Appium process: /Users/abilican/Documents/projects/perso/elastos/react-native-elastos-wallet-core-demo/node_modules/appium/build/lib/main.js
2019-05-01T06:46:06.002Z DEBUG @wdio/appium-service: Appium started with ID: 53905
2019-05-01T06:46:06.004Z INFO @wdio/local-runner: Start worker 0-0 with arg: config/wdio.ios.app.conf.js
RUNNING 0-0 in ./ios/RNMainchainDemoArchive/RNMainchainDemo.ipa - /test/specs/native.js
Worker information
hostname: bbe861a6-190a-4344-b31c-d8a30863e22a@1.worker-org-6bc68c5dcd-rn7ms.macstadium-prod-2
version: v6.2.0 https://github.com/travis-ci/worker/tree/5e5476e01646095f48eec13196fdb3faf8f5cbf7
instance: cc6c49f0-42d2-461d-807c-b022d24e8c98 travis-ci-macos10.13-xcode10.1-1540999528 (via amqp)
startup: 1m3.998322605s
nvm is not compatible with the npm config "prefix" option: currently set to "/usr/local"
Run `npm config delete prefix` or `nvm use --delete-prefix v10.13.0 --silent` to unset it.
Build system information
Build language: node_js
Build id: 526755334
stripe.paymentMethods.create({
customer: 'cus_XXXXXXX',
payment_method: 'pm_XXXXXXX',
},{
stripe_account: 'acct_XXXXXXX',
}).then(function(paymentMet) {
stripe.paymentIntents.create({
amount: 1000,
currency: 'chf',
@ademcan
ademcan / ems_parta.js
Created January 18, 2020 15:48
EMS_partA
// create new Kyber objects
const KYBOBJECT = await new KYBLIB.Kyber.empty()
// Take a 32 byte seed, s
const s = Crypto.randomBytes(32)
// Create a random 32 byte key, k
const k = Crypto.randomBytes(32)
var textBytes = aesjs.utils.utf8.toBytes(s)
[{"iv":{"type":"Buffer","data":[255,46,61,55,12,97,147,159,17,185,149,218,90,60,85,155]},"ephemPublicKey":{"type":"Buffer","data":[4,76,246,11,99,112,237,77,246,255,115,30,114,184,14,48,59,136,147,235,237,79,18,14,184,72,216,21,255,1,92,139,32,83,163,167,114,197,115,144,236,128,238,196,219,8,67,23,181,170,227,149,34,238,80,224,47,215,157,28,71,99,83,54,148]},"ciphertext":{"type":"Buffer","data":[107,13,232,105,10,78,231,11,114,65,182,192,220,175,188,178,239,204,147,244,67,231,225,58,52,235,12,183,75,108,94,13,224,110,251,114,160,117,199,143,215,229,76,146,49,252,140,56,206,119,91,110,227,195,202,228,46,136,78,212,205,13,30,78,230,51,211,230,233,29,208,244,178,30,248,192,242,229,16,109,234,140,123,245,123,110,211,36,8,9,19,13,126,135,24,76,251,234,154,62,117,16,15,0,229,91,103,140,80,38,102,85,232,165,40,147,230,185,80,55,168,90,114,98,221,248,250,107,165,102,148,203,208,141,162,125,170,143,113,0,45,190,155,164,123,230,74,24,163,202,163,155,65,117,49,61,241,45,177,60,71,198,19,116,218,206,204,59,93,155,63,168,
#import "AppDelegate.h"
#import <React/RCTBridge.h>
#import <React/RCTBundleURLProvider.h>
#import <React/RCTRootView.h>
#import <Stripe/Stripe.h>
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
#import <React/RCTBridgeDelegate.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate, RCTBridgeDelegate>
@property (nonatomic, strong) UIWindow *window;
@property (nonatomic, strong) UIViewController *rootViewController;
@end