Skip to content

Instantly share code, notes, and snippets.

View marekkrzynowek's full-sized avatar

marekkrzynowek

  • Montrose Software LLC
  • Kraków
View GitHub Profile
/* eslint-env mocha */
/* eslint prefer-arrow-callback: off */
const sinon = require('sinon');
const AWS = require('aws-sdk-mock');
const { utils } = require('@ucapp/unioncore-test-utils');
const expect = require('expect');
const hello = require('../hello.js');
let SNS_SPY;
const utils = require('@ucapp/unioncore-utils');
const AWS = require('aws-sdk');
module.exports.helloWorld = async (event, context) => {
context.callbackWaitsForEmptyEventLoop = false;
try {
const msgs = [];
for (const r of event.Records) {
const payload = _extractMessageFromPayload(r);
const _ = require('lodash');
const createEvent = require('aws-event-mocks');
const expect = require('expect');
const yaml = require('js-yaml');
const fs = require('fs');
const dotenv = require('dotenv');
const diff = require('deep-diff');
const fns = {};
/**
extension UIView {
func animateTo(frame: CGRect, withDuration duration: TimeInterval, completion: ((Bool) -> Void)? = nil) {
guard let _ = superview else {
return
}
let xScale = frame.size.width / self.frame.size.width
let yScale = frame.size.height / self.frame.size.height
let x = frame.origin.x + (self.frame.width * xScale) * self.layer.anchorPoint.x
let y = frame.origin.y + (self.frame.height * yScale) * self.layer.anchorPoint.y
let x = frame.origin.x + (self.frame.width * xScale) * self.layer.anchorPoint.x
let y = frame.origin.y + (self.frame.height * yScale) * self.layer.anchorPoint.y
let x = frame.origin.x + (self.frame.width * xScale)/2
let y = frame.origin.y + (self.frame.height * yScale)/2
smallSquare.animateTo(frame: CGRect(x: 60, y: 60, width: 80, height: 80), withDuration: 1)
func animateTo(frame: CGRect, withDuration duration: TimeInterval, completion: ((Bool) -> Void)? = nil) {
guard let _ = superview else {
return
}
let xScale = frame.size.width / self.frame.size.width
let yScale = frame.size.height / self.frame.size.height
let x = frame.origin.x + (self.frame.width * xScale)/2
let y = frame.origin.y + (self.frame.height * yScale)/2
UIView.animate(withDuration: duration, delay: 0, options: .curveLinear, animations: {
UIView.animate(withDuration: 1) {
smallSquare.layer.position = CGPoint(x: 60, y: 60)
smallSquare.transform = CGAffineTransform.identity.scaledBy(x: 2, y: 2)
}
UIView.animate(withDuration: 1) {
smallSquare.layer.position = CGPoint(x: 60, y: 60)
}