This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local timer = require("hs.timer") | |
local eventtap = require("hs.eventtap") | |
local keycodes = require("hs.keycodes") | |
local events = eventtap.event.types | |
local timeFrame = 0.2 | |
local f_key = 3 | |
local pressTime, firstDown = 0, false | |
function twoHandler() | |
local frontmostAppName = hs.application.frontmostApplication():name() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
import PlaygroundSupport | |
// Helper functions | |
func * (point: CGPoint, scalar: CGFloat) -> CGPoint { | |
return CGPoint(x: point.x * scalar, y: point.y * scalar) | |
} | |
func + (left: CGPoint, right: CGPoint) -> CGPoint { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
import PlaygroundSupport | |
// Helper functions | |
func * (point: CGPoint, scalar: CGFloat) -> CGPoint { | |
return CGPoint(x: point.x * scalar, y: point.y * scalar) | |
} | |
func + (left: CGPoint, right: CGPoint) -> CGPoint { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//: Playground - noun: a place where people can play | |
import UIKit | |
import PlaygroundSupport | |
func drawCircle(x: CGFloat, y: CGFloat) { | |
let p = UIBezierPath(ovalIn: CGRect(x: x, y: y, width: 10, height: 10)) | |
UIColor.blue.setFill() | |
p.fill() | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import UIKit | |
/* Extension for croping transparent pixels | |
example: | |
let image: UIImage = UIImage(imageLiteral: "YOUR_IMAGE") | |
let uiImageView = UIImageView(image: image.cropImageByAlpha()) | |
view.addSubview(uiImageView) | |
Code was basically done here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Actionscript | |
* Json to value object converter | |
* | |
* @author André Niet | |
* @version 0.1 | |
*/ | |
package util { | |
import flash.utils.Dictionary; | |
import flash.utils.describeType; |