- Crab:
- Golden fish:
- Seal ?
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
enum EDGE { LEFT = -1, RIGHT = 1, TOP = -1, BOTTOM = 1, FAR = -1, NEAR = 1 } | |
func get_edge_position(target, direction_x = EDGE.LEFT, direction_y = EDGE.TOP ): | |
var edge = target.global_position | |
var half_size = target.get_current_size() / 2 | |
edge.x += half_size.x * direction_x | |
edge.y += half_size.y * direction_y | |
return edge | |
func compare_edge(target, edge, distance = EDGE.NEAR): |
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 Connection_manager: | |
# State / cache | |
var connections = {} | |
var memoized_hash = 0 | |
var memoized_input_connections = {} | |
# Events | |
signal on_connection_added | |
signal on_connection_removed | |
func has(target, origin): |
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 History_manager: | |
var history = [] | |
var pointer = -1 | |
var max_size = 5 | |
var has_undo = false | |
var has_redo = false | |
var action_after_undo = false | |
signal history_change | |
func _init(new_max_size = 5): |
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
extends Spatial | |
# Declare member variables here. Examples: | |
# var a = 2 | |
# var b = "text" | |
export var speed = 0.4 | |
export var max_speed = 1.8 |
- a
- b
- c
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
alert('testing...); |
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
const parseCsv = (data, filters = []) => { | |
// Get items for header | |
const getHeaders = item => { | |
const list = []; | |
// Apply filters | |
Object.entries(item).forEach(([key]) => { | |
if (!filters.includes(key)) list.push(key); | |
}); | |
// return headers |
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
// Linux patch for electron: shell.showItemInFolder | |
const { execFile } = require('child_process'); | |
// Parse application name | |
//https://gist.github.com/btzr-io/abb2f2995a63c08bbdc655d9849c69ff | |
const parseName = (name) => name.replace(/\s+/g, '') | |
.split(".") | |
.filter( key => key !== "org" && key !== "desktop") | |
.join("-"); |
NewerOlder