Skip to content

Instantly share code, notes, and snippets.

View koenbok's full-sized avatar

Koen Bok koenbok

View GitHub Profile
layerA = new Layer
# Check the force value
layerA.on Events.ForceTap, (event) ->
print event.force
layerA = new Layer
# Enable pinching & panning
layerA.pinchable.enabled = true
layerA.draggable.enabled = true
# Current click event
layerA.on Events.Click, -> ...
# With a shortcut
layerA.onClick -> ...
layerA = new Layer
layerB = new Layer
# The old way
layerB.superLayer = layerA
print layerA.subLayers
# The new way
layerB.parent = layerA
print layerA.children
@koenbok
koenbok / advanced.md
Last active May 5, 2019 14:34
Learn Programming

Advanced Programming

Programming setup

  • Instant visual output.
  • Fast startup time, fast execution.
  • Sensible errors, with code locations.
  • Easy to set up and get working.

Architecture

@koenbok
koenbok / Makefile
Created February 13, 2016 11:36
Updating subprojects in Makefiles
# Preferred way to deal with subprojects, because we want to avoid submodules.
# This way we do everything explicitly, and can verify everything in commits.
# We need to always keep master in good condition.
TMP = ./tmp
PROJECT_TEMP = $(TMP)/FramerSketch
PROJECT_GIT = git@github.com:motif/FramerSketch2.git
update%project:
@mkdir -p $(TMP)
# Hello Jordan!
layer = new Layer
interface Node {
id: string
type: string
children: List<Node>
}
class Tree {
// Create and remove (updates root)
create(type: string, parent: string|null|Node= null, attributes: any = {}): Node {}
// Internal types
interface NodeType {
id: string
type: string
attributes: Map<string, any>
children: List<NodeType>
}