raspi config ssh problem

ssh pi@192.168.1.27
Connection reset by 192.168.1.27 port 22
solution:

sudo rm /etc/ssh/ssh_host_* && sudo dpkg-reconfigure openssh-server

Path Finding

import GameplayKit

let graph = GKGraph()


let nodeA = GKGraphNode()
let nodeB = GKGraphNode()
let nodeC = GKGraphNode()
let nodeD = GKGraphNode()
let nodeE = GKGraphNode()


graph.addNodes([nodeA,nodeB,nodeC,nodeD,nodeE])
nodeA.addConnectionsToNodes([nodeB,nodeD], bidirectional: true)
nodeB.addConnectionsToNodes( [nodeD], bidirectional: true)
nodeC.addConnectionsToNodes( [nodeE], bidirectional: false)
nodeD.addConnectionsToNodes( [nodeC], bidirectional: false)
let path:[GKGraphNode] = graph.findPathFromNode(nodeA, toNode: nodeE)

Tags: 

Server side Swift

Kitura

mkdir serverside
cd serverside/
mkdir server
cd server
docker run -itv $(pwd):/projects --name projects -w /projects -p 8089:8089 -p 8090:8090 -p 5984:5984 twostraws/server-side-swift /bin/bash
docker start projects
docker attach projects
root@c661e0faa890:/projects# mkdir project1
root@c661e0faa890:/projects# cd project1/
root@c661e0faa890:/projects/project1# swift package init --type executable
root@c661e0faa890:/projects/project1# swift build
root@c661e0faa890:/projects/project1# .build/debug/project1
Hello, world!

change package to:
let package = Package(
name: "project1",
dependencies: [
.Package(url: "https://github.com/IBM-Swift/Kitura.git", majorVersion: 1),
.Package(url: "https://github.com/IBM-Swift/HeliumLogger.git", majorVersion: 1),
.Package(url: "https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git", majorVersion: 1)
]
)

swift build
swift package generate-xcodeproj

docker ps - shows a list of running containers
docker ps -a shows list all projects

docker start #NAME PROJ#
docker attach #NAME#
ctrl-p ctrl-q to get back to local terminal without stopping
docker start -i #NAME#

Vapor

Use & adjust Post template.
change in fluent.json
"driver":"memory" into "driver":"sqlite"

create
sqlite.json
insert
{
"path":"pokemonDB.sqlite"
}

in config+Setup
change setupPreparations into desired Pokemon class

private func setupPreparations() throws {
        preparations.append(Post.self)
        preparations.append(Pokemon.self)
    }

in router
get("version"){
            request in
            let result = try Pokemon.database?.driver.raw("select sqlite_version();")
            return try JSON(node: result)
        }

MySql

start mysql server
docker run -p 3306:3306 --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:latest

Tags: 

bitbucket push origin problem

With Bitbucket problem on the raspi :
git push -u origin master
Counting objects: 87, done.
error: pack-objects died of signal 9
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
../html# fatal: write error: Bad file descriptor

git config pack.windowMemory 10m
git config pack.packSizeLimit 20m

combine adding CGRects in array

Adding two CGRect:

let area0 = CGRectZero //{x 0 y 0 w 0 h 0}
let area1 = CGRect(x:0,y:0,width: 2.0, height: 2.0)//{x 0 y 0 w 2 h 2}
let area2 = CGRect(x:2.0,y:2.0,width: 2.0, height: 2.0)
let area3 = CGRect(x:4.0,y:4.0,width: 2.0, height: 2.0)
let union = CGRectUnion(area1, area2)//{x 0 y 0 w 4 h 4}

in an array
var areatotal:[CGRect] = []
areatotal.append(area1)
areatotal.append(area2)
areatotal.append(area3)
areatotal.append(area0)
areatotal.reduce(CGRectZero, combine: CGRectUnion)//{x 0 y 0 w 6 h 6}

Tags: 

Nginx

apt-get update
apt-get install nginx
service nginx start

Download the init script for the relevant platform and save it to /etc/rc.d/init.d/nginx
chmod +x /etc/rc.d/init.d/nginx

directives and context

renumber id column

SET @i=0;
UPDATE table_name SET column_name=(@i:=@i+1);

set @rank=0;select @rank:=@rank+1 as rank , screenname, score from gameScore order by score desc;

select groep , screenname from user where userGroup.groep < 98 order by groep;

Tags: 

remove mongo

# See if mongo is in the launch/startup list
launchctl list | grep mongo

# Remove mongodb from the launch/startup
launchctl remove homebrew.mxcl.mongodb

# Kill the mongod process just in case it's running
pkill -f mongod

# Now you can safely remove mongodb using Homebrew
brew uninstall mongodb

Tags: 

Docker

run docker app
then

docker pull swift
docker pull postgres:alpine

docker container run -d -p 3306:3306 --name mysql -e MYSQL_RANDOM_ROOT_PASSWORD=yes  mysql
docker container run --name mysql -p 3306:3306 -e MYSQL_RANDOM_ROOT_PASSWORD=yes -d mysql
docker container logs mysql
docker exec -it mysql bash -l

docker container run -d --name mysql -e MYSQL_ROOT_PASSWORD=root -p 3306 -v /Users/lappie2010/Documents/docker/mysql/:/var/lib/mysql mysql


docker container logs mysql

docker container run -d --name webserver -p 8080:80 httpd

docker container run -d --name proxy -p 80:80 nginx


docker run --cap-add sys_ptrace -it --privileged=true swift bash

Docker Mysql + Wordpress

docker container run -d \
    --name wordpress \
--link mysql:mysql\
    -p 8080:80 \
    -e WORDPRESS_DB_PASSWORD=root \
    wordpress

    docker container run -d \
        --name mysql \
        -e MYSQL_ROOT_PASSWORD=root \
        -e MYSQL_DATABASE=wordpress \
        mysql

Tags: 

Swift Perfect

mkdir hjh
cd hjh
swift package init --type executable
swift package generate-xcodeproj
open ./hjh.xcodeproj/

edit package.swift

import PackageDescription
let package = Package(
  name: "hjh",
  dependencies: [
    .Package(url: "https://github.com/PerfectlySoft/Perfect-
HTTPServer.git", majorVersion: 2),
    .Package(url: "https://github.com/SwiftORM/SQLite-StORM.git",
majorVersion: 1, minor: 0),
    .Package(url: "https://github.com/PerfectlySoft/Perfect-
Mustache.git", majorVersion: 2),
] )

terminal:

swift package update
swift package generate-xcodeproj

main.swift:

import PerfectLib
import PerfectHTTP
import PerfectHTTPServer

terminal:

mkdir public
touch public/file.txt
swift package generate-xcodeproj

terminal:

mkdir public
touch public/file.txt
swift package generate-xcodeproj

let server = HTTPServer()
server.serverPort = 8080
server.documentRoot = "public"

do {
  try server.start()
} catch PerfectError.networkError(let err, let msg) {
  print("Network error thrown: \(err) \(msg)")
}

// func for fitst json response
func jsonresponsefunc(request: HTTPRequest, response: HTTPResponse) {
  do {
    try response.setBody(json: ["message": "JSON!"])
      .setHeader(.contentType, value: "application/json")
      .completed()
  } catch {
    response.setBody(string: "Error handling request: \(error)")
      .completed(status: .internalServerError)
  }
}
// routes
var routes = Routes()
routes.add(method: .get, uri: "/", handler: jsonresponsefunc)
server.addRoutes(routes)

Tags: 

Read file

file io swift 2.2

        let fileLocation = NSBundle.mainBundle().pathForResource("2311393", ofType: "xml")!
        let text : String
        do
        {
            text = try String(contentsOfFile: fileLocation)
        }
        catch
        {
            text = ""
        }

Tags: 

App installed

func isAppInstalled(name:String)->Bool {
    return UIApplication.sharedApplication().canOpenURL(NSURL(string:"\(name):")!)
}

Tags: 

Meteor setup project with accounts

Router:

meteor add iron:router

Bootstrap:

meteor add twbs:bootstrap

Accounts:

meteor add accounts-ui accounts-password
meteor add joshowens:accounts-entry
meteor npm install --save bcrypt
meteor add check

adjust client with code from
https://github.com/Differential/accounts-entry/

meteor

Install
cd $HOME

git clone --depth 1 https://github.com/4commerce-technologies-AG/meteor.git

#now it installs if it is the first time!
$HOME/meteor/meteor --version

==========================
======= slow version =======
==========================

cd $HOME

git clone --depth 1 https://github.com/4commerce-technologies-AG/meteor.git

cd meteor

Build bundled node:

scripts/build-node-for-dev-bundle.sh

Get mongodb installation from OS (e.g. Debian based):

sudo apt-get install mongodb

Optional (long runner) build bundled mongo:

scripts/build-node-for-dev-bundle.sh
Beneath the compiler and development tools and standard libaries, you have to also install the zlib1g-dev (or whatever it's named on your OS) library sources. Otherwise the mongo build will fail with an error like "-lz is missing"

Build meteor dev_bundle:

scripts/generate-dev-bundle.sh

Check installed version:

$HOME/meteor/meteor --version
==========================
========= helpfull snips =====
==========================

cd $HOME

# get the command line to checkout the meteor example
$HOME/meteor/meteor create --example simple-todos-react

# this is what you will receive as command hint, so put it in
git clone https://github.com/meteor/simple-todos-react

# jump into the project folder
cd simple-todos-react

# get necessary npm stuff
$HOME/meteor/meteor npm install

# bring that project up to latest module updates
$HOME/meteor/meteor update --packages-only

# add one package to avoid counting of modules usage and DDP error message on start
$HOME/meteor/meteor add package-stats-opt-out

# run that app
$HOME/meteor/meteor

Raspberry gpio

Read value

import RPi.GPIO as GPIO

# read value
GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.IN)
poweron = GPIO.input(21)
GPIO.cleanup(21)

print "turnonheater"
    GPIO.setup(21,GPIO.OUT, initial=GPIO.HIGH)
    GPIO.output(21, GPIO.HIGH)
    GPIO.cleanup(21)

print "turnoffheater"
    GPIO.setup(21,GPIO.OUT, initial=GPIO.LOW)
    GPIO.output(21, GPIO.LOW)
    GPIO.cleanup(21)

Crash Log Helper

.h

@interface CrashLogHelper : NSObject

+(void) writeNoCrashFile;
+(void) removeNoCrashFile;

.m
+(void) writeNoCrashFile
{
    NSError *error;
    NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"crashloggername.txt"];
    NSLog(@"file path for write nocrash file%@", filePath);
    NSFileManager *filemgr;
   
    filemgr = [NSFileManager defaultManager];
   
    if ([filemgr fileExistsAtPath: filePath ] == YES)
    {
        NSLog (@"File exists, so it did crash");
        [App.persistenceHelper setString:@"-1" forPersistentKey:PERSISTENCEHELPER_ratingsequence];
    }
    else
    {
        NSLog (@"File not found");
        // write new file
        NSString *stringToWrite = @"no crash";
        [stringToWrite writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:&error];
    }
}
+(void) removeNoCrashFile
{
    NSFileManager *filemgr;
    NSError *error;
    filemgr = [NSFileManager defaultManager];
    NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"crashlogger.txt"];
  
    if ([filemgr fileExistsAtPath: filePath ] == YES){
        NSLog (@"File exists so remove");
        BOOL success = [filemgr removeItemAtPath:filePath error:&error];
        if (success) {
            NSLog(@"file removed");
        }
        else
        {
            NSLog(@"Could not delete file -:%@ ",[error localizedDescription]);
        }
    }
    else{
        NSLog (@"File not found"); // something fishy
    }
   
}

Tags: 

Screenwidth screen height

+ (CGFloat) getScreenWidth
{
    CGFloat swidth = [UIScreen mainScreen].bounds.size.width;
    CGFloat sheight = [UIScreen mainScreen].bounds.size.height;
    return MIN(swidth, sheight);
}

+ (CGFloat) getScreenHeight
{
    CGFloat swidth = [UIScreen mainScreen].bounds.size.width;
    CGFloat sheight = [UIScreen mainScreen].bounds.size.height;
    return MAX(swidth, sheight);
}

Tags: 

Read Write file IO

+(void) writeTextFile
{
    NSError *error;
    NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"text.txt"];
    NSFileManager *filemgr;
   
    filemgr = [NSFileManager defaultManager];
   
    if ([filemgr fileExistsAtPath: filePath ] == YES)
    {
        NSLog (@"File exists");
    }
    else
    {
        NSLog (@"File not found");
        // write new file
        NSString *stringToWrite = @"text text text";
        [stringToWrite writeToFile:filePath atomically:YES encoding:NSUTF8StringEncoding error:&error];
    }
}
+(void) removeTextFile
{
    NSFileManager *filemgr;
    NSError *error;
    filemgr = [NSFileManager defaultManager];
    NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) firstObject] stringByAppendingPathComponent:@"text.txt"];
  
    if ([filemgr fileExistsAtPath: filePath ] == YES){
        NSLog (@"File exists so remove");
        BOOL success = [filemgr removeItemAtPath:filePath error:&error];
        if (success) {
            NSLog(@"file removed");
        }
        else
        {
            NSLog(@"Could not delete file -:%@ ",[error localizedDescription]);
        }
    }
    else{
        NSLog (@"File not found"); // something fishy
    }
   
}

Tags: 

port mysql

SHOW GLOBAL VARIABLES LIKE 'PORT';

Tags: 

Drupal small core update drush

sudo apt-get update

put in maintenance mode:
drush vset --exact maintenance_mode 1 drush cache-clear all
update:
drush pm-update drupal
put out of maintenance mode:
drush vset --exact maintenance_mode 0 drush cache-clear all

Swift raspberry

sudo apt-get update
sudo apt-get install -y clang
wget https://s3-us-west-2.amazonaws.com/swiftpi.swiftlite.v1/swift-lite-3.0-r...
sudo tar -xzpf swift-lite-3.0-raspberrypi-universal.tar.gz -C/

examples
wget https://s3-us-west-2.amazonaws.com/swiftpi.swiftlite.v1/helloworld3.tar.gz
tar -xzpf helloworld3.tar.gz

cleanup
rm swift-lite-3.0-raspberrypi-universal.tar.gz helloworld3.tar.gz

to build
cd swiftProjects
swift-lite-build helloworld.swift

test/run
./helloworld.swapp

swift server Kitura

first

mkdir tuinhok
cd tuinhok
swift package init --type executable

adjust Package.swift
import PackageDescription


let package = Package(
  name: "proj1",
  dependencies: [
    .Package(url: "https://github.com/IBM-Swift/Kitura.git",
             majorVersion: 1),
    .Package(url: "https://github.com/IBM-Swift/HeliumLogger.git", majorVersion: 1),
    .Package(url: "https://github.com/IBM-Swift/Kitura-StencilTemplateEngine.git", majorVersion: 1)
    ]
)

swift package generate-xcodeproj
mkdir public - for js css img etc
mkdir Views - for stencil files

in main swift
import Kitura
import LoggerAPI
import HeliumLogger
import KituraStencil

HeliumLogger.use(.info)
let router = Router()
router.setDefault(templateEngine: StencilTemplateEngine())
router.all("/static", middleware: StaticFileServer())

router.get("/") {
  request, response, next in
  defer { next() }
  try response.render("home", context: [:])
}

Kitura.addHTTPServer(onPort: 8090, with: router)

Kitura.run()

Tags: 

size database

SELECT table_schema NAMEOFDB,
sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES GROUP BY table_schema ;

Tags: 

xcode 3.7.1 cocoapods

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!

target 'testNetworkingOperation' do
    pod 'Alamofire', '~> 3.0'
     pod 'SwiftyJSON', '2.4.0'
end

Tags: 

nodejs express

npm init

npm install express --save
npm install body-parser --save
npm install nodemon --save / --g
npm install bcryptjs --save

create app.js

var express = require('express');
var bodyParser = require('body-parser');
var app = express();

app.get('/', function (req, res) {
  res.send('Hello World!')
})

app.listen(3000, function () {
  console.log('listening on port 3000')
})

Tags: 

Symphony snips

timezone
in app kernel.php

public function __construct($environment, $debug)
{
    date_default_timezone_set('Europe/Amsterdam');
    parent::__construct($environment, $debug);
}

server:
php bin/console server:run

php bin/console generate:bundle

composer require knplabs/knp-menu-bundle dev-master

bin/console doctrine:database:create
( drop:
bin/console doctrine:database:drop --force
)

bin/console doctrine:generate:entity
bin/console doctrine:schema:update --force

Fish, bash commands as functions

make Atom.app run from terminal:

ln -s /Applications/Atom.app/Contents/Resources/app/atom.sh /usr/local/bin/atom

make function in Fish:
nano ~/.config/fish/functions/atom.fish

some functions:
function atom
    bash -c 'atom .'
end
function pstorm
    bash -c 'open -a /Applications/PhpStorm.app .'
end

function xcodeclean
        command rm -rf ~/Library/Developer/Xcode/DerivedData/*
end

function ll
    ls -lahG $argv
end

Tags: 

log vector

// log vector
for (auto const& c : numbers)
{
    std::cout << c << ' ';
}

Tags: 

Before After in collection

public extension Collection where Iterator.Element: Equatable {

public func after(_ element: Iterator.Element) -> Iterator.Element? {
guard let idx = index(of: element), index(after: idx) < endIndex else { return nil }
let nextIdx = index(after: idx)
return self[nextIdx]
}

public func before(_ element: Iterator.Element) -> Iterator.Element? {
guard let idx = index(of: element), index(before: idx) >= startIndex else { return nil }
let previousIdx = index(idx, offsetBy: -1)
return self[previousIdx]
}

public func index(before idx: Index) -> Index {
return index(idx, offsetBy: -1)
}
}

Tags: 

ZoomableGridVC

enum GridFillDirection
{
    case Horizontal, Vertical
}

class ZoomableGridViewController: UIViewController,UIScrollViewDelegate {
   
    //MARK: - Properties
   
    var scrollView: UIScrollView!
    var scrollIsZoomedIn = false
    var gridView: UIView!//Grid!//or image etc
   
    var puzzleDirection:GridFillDirection = .Horizontal
   
    var logText:UILabel!
   
    //MARK: - VC
    override func viewDidLoad() {
        super.viewDidLoad()
       
        gridView = UIImageView(image: UIImage(named: "nasa_big"))//UIView(frame: CGRectMake(0,0,view.bounds.width,view.bounds.width))//
       
        scrollView = UIScrollView(frame: CGRectMake(0,80,view.bounds.width,view.bounds.width))
        scrollView.backgroundColor = UIColor.blackColor()
        scrollView.contentSize = gridView.bounds.size
        scrollView.autoresizingMask = UIViewAutoresizing.FlexibleWidth
        scrollView.delegate = self
        scrollView.maximumZoomScale = 4.0
        setZoomScale()
        scrollView.contentOffset = CGPoint(x: 0, y: 0)
        scrollView.addSubview(gridView)
        view.addSubview(scrollView)
       
        setupGestureRecognizer()
       
        setupLogText()
    }
   
    //MARK: - Setup Layout
    func setupLogText()
    {
        let logtextHeight:CGFloat = 40
        logText = UILabel(frame: CGRectMake(0,view.bounds.height-logtextHeight,view.bounds.width,logtextHeight))
        logText.textAlignment = .Center
        view.addSubview(logText)
        createLogText()
    }
   
    func createLogText()
    {
        let text = (puzzleDirection == .Horizontal) ? "Hori" :  "Verti"
        logText.text = "\(text) zoom : \(scrollView.zoomScale) "
    }
   
    func setZoomScale() {
       
        let widthScale = scrollView.bounds.size.width / gridView.bounds.size.width
        let heightScale = scrollView.bounds.size.height / gridView.bounds.size.height
       
        scrollView.minimumZoomScale = min(widthScale, heightScale)
        scrollView.zoomScale = widthScale
    }
   
    //MARK: - ScrollView delegates
    func viewForZoomingInScrollView(scrollView: UIScrollView) -> UIView? {
        return gridView
    }
   
    func scrollViewDidZoom(scrollView: UIScrollView) {
       
        let verticalPadding = gridView.bounds.size.height < scrollView.bounds.size.height ? (scrollView.bounds.size.height - gridView.bounds.size.height) / 2 : 0
        let horizontalPadding = gridView.bounds.size.width < scrollView.bounds.size.width ? (scrollView.bounds.size.width - gridView.bounds.size.width) / 2 : 0
       
        scrollView.contentInset = UIEdgeInsets(top: verticalPadding, left: horizontalPadding, bottom: verticalPadding, right: horizontalPadding)
       
    }
   
    //MARK: - Gestures
    func setupGestureRecognizer() {
        let doubleTap = UITapGestureRecognizer(target: self, action: #selector(ZoomableGridViewController.handleDoubleTap(_:)))
        doubleTap.numberOfTapsRequired = 2
        scrollView.addGestureRecognizer(doubleTap)
       
        let singleTap = UITapGestureRecognizer(target: self, action: #selector(ZoomableGridViewController.handleSingleTap(_:)))
        singleTap.numberOfTapsRequired = 1
        scrollView.addGestureRecognizer(singleTap)
       
        let swipeRight = UISwipeGestureRecognizer(target: self, action: #selector(ZoomableGridViewController.handleSwipeGesture(_:)))
        swipeRight.direction = UISwipeGestureRecognizerDirection.Right
        self.view.addGestureRecognizer(swipeRight)
       
        let swipeDown = UISwipeGestureRecognizer(target: self, action: #selector(ZoomableGridViewController.handleSwipeGesture(_:)))
        swipeDown.direction = UISwipeGestureRecognizerDirection.Down
        self.view.addGestureRecognizer(swipeDown)
       
        let swipeLeft = UISwipeGestureRecognizer(target: self, action: #selector(ZoomableGridViewController.handleSwipeGesture(_:)))
        swipeLeft.direction = UISwipeGestureRecognizerDirection.Left
        self.view.addGestureRecognizer(swipeLeft)
       
        let swipeUp = UISwipeGestureRecognizer(target: self, action: #selector(ZoomableGridViewController.handleSwipeGesture(_:)))
        swipeUp.direction = UISwipeGestureRecognizerDirection.Up
        self.view.addGestureRecognizer(swipeUp)
       
    }
   
    func handleSwipeGesture(gesture: UIGestureRecognizer) {
       
        if let swipeGesture = gesture as? UISwipeGestureRecognizer {
           
            createLogText()
            switch swipeGesture.direction {
            case UISwipeGestureRecognizerDirection.Right:
               
                logText.text? += "Swiped right select next horizontal region"
                if swipeGesture.state == UIGestureRecognizerState.Began
                {
                   
                }
               
            case UISwipeGestureRecognizerDirection.Down:
               
                logText.text? += "Swiped down select next vertical region"
               
               
            case UISwipeGestureRecognizerDirection.Left:
               
                logText.text? += "Swiped left select previous horizontal region"
               
               
            case UISwipeGestureRecognizerDirection.Up:
               
               
                logText.text? += "Swiped up select previous vertical region"
               
               
            default:
                break
            }
        }
    }
   
    func checkZoomState()
    {
        let widthScale = scrollView.bounds.size.width / gridView.bounds.size.width
        if widthScale == scrollView.zoomScale
        {
            //print("zoom scale full")
            scrollIsZoomedIn = false
        }
        else
        {
            //print("zoom scale zoomed")
            scrollIsZoomedIn = true
        }
    }
   
    func handleSingleTap(recognizer: UITapGestureRecognizer)
    {
        checkZoomState()
        createLogText()
        if scrollIsZoomedIn
        {
            logText.text? += "singleTap - selected cell if selected change direction"
        }
        else
        {
            logText.text? += "singleTap - selected cell "
        }
    }
   
    func handleDoubleTap(recognizer: UITapGestureRecognizer) {
        //print("double tap")
        checkZoomState()
        createLogText()
        if puzzleDirection == .Horizontal
        {
            puzzleDirection = .Vertical
        }
        else
        {
            puzzleDirection = .Horizontal
        }
    
    }
 
}

Tags: 

Pages

Subscribe to hjsnips RSS