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
this.bindDynamicFunction = function(o, property, value){ | |
var _value = value; | |
var _funcName = (property.charAt(0).toUpperCase() + property.slice(1)); | |
o["get" + _funcName] = function(){ | |
return _value; | |
}; | |
o["set" + _funcName] = function(v){ | |
_value = v; | |
}; | |
}; |
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
function love.update(dt) | |
if love.keyboard.isDown('d') then | |
x = x + 100 * dt | |
end | |
if love.keyboard.isDown('a') then | |
x = x - 100 * dt | |
end | |
if love.keyboard.isDown('w') then | |
y = y - 1 * dt | |
end |
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
tell application "iTerm" | |
if the transparency of the current session of the current terminal > 0 then | |
set the transparency of the current session of the current terminal to 0 | |
else | |
set the transparency of the current session of the current terminal to 0.2 | |
end if | |
end tell |
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
// UniForm PEG | |
// @autos #miles 3000 | |
start = | |
expression | |
expression = cat:category* prop:property* {return JSON.stringify({"category": cat, properties:prop}, undefined, 2); } | |
category = whitespace '@'symbol:word whitespace { return symbol; } | |
property = whitespace |
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
function love.load() | |
love.mouse.setVisible(false) | |
board = { | |
width = 13, | |
height = 6 | |
} | |
-- Each subarray of stops defines the beginning and end color | |
-- of a row. |
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
extension SCNAction { | |
static func oscillation(amplitude a: CGFloat, timePeriod t: Double) -> SCNAction { | |
let action = SCNAction.customAction(duration: t) { node, currentTime in | |
let displacement = a * sin(2 * .pi * currentTime / CGFloat(t)) | |
node.position.x = Float(displacement) | |
} | |
return action | |
} | |
} |
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
class ViewController: UIViewController, ARSCNViewDelegate { | |
// Rest of class code goes above here ... | |
func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) { | |
var status = "Loading..." | |
switch camera.trackingState { | |
case .notAvailable: | |
status = "Not available" | |
case .limited(_): |
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
class ViewController: UIViewController, ARSCNViewDelegate { | |
// Rest of class code goes above here ... | |
func session(_ session: ARSession, cameraDidChangeTrackingState camera: ARCamera) { | |
var status = "Loading..." | |
switch camera.trackingState { | |
case .notAvailable: | |
status = "Not available" | |
case .limited(_): |
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
func exposeAtPoint(point: CGPoint) { | |
let device = activeInput.device // var activeInput: AVCaptureDeviceInput! | |
if device.isExposurePointOfInterestSupported && device.isExposureModeSupported(.continuousAutoExposure) { | |
do { | |
try device.lockForConfiguration() | |
device.exposurePointOfInterest = point | |
device.exposureMode = .continuousAutoExposure | |
if device.isExposureModeSupported(.locked) { | |
device.addObserver(self, forKeyPath: "adjustingExposure", options: .new, context: &adjustingExposureContext) |
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
// | |
// Trie.swift | |
// AutoCorrect | |
// | |
// Created by Shaul Hameed on 30/07/17. | |
// | |
// | |
OlderNewer