This file contains hidden or 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 array_to_string(a: Array) -> String: | |
return PoolStringArray(a).join("\n") |
This file contains hidden or 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
# Add to main autoload file | |
func _ready(): | |
# Check the last child node of the root | |
var scene_node = get_node("/root").get_children()[-1] | |
if scene_node.filename != ProjectSettings.get_setting("application/run/main_scene"): | |
var property = "position" | |
if scene_node is Control: | |
property = "rect_" + property | |
set(property, get_viewport().size / 2) |
This file contains hidden or 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 _input(_event): | |
if Input.is_action_just_pressed("ui_cancel"): | |
get_tree().quit() |
This file contains hidden or 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 Node2D | |
func _ready(): | |
yield(VisualServer, "frame_post_draw") | |
var img = $ViewportContainer/Viewport.get_texture().get_data() | |
img.flip_y() | |
img.save_png("vp_image.png") | |
img = $VP3D/Viewport.get_texture().get_data() |
This file contains hidden or 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
<?php | |
/* | |
This script is placed on a server or computer that remains powered up and is run via a | |
crontab job at regular intervals to ensure that the reverse SSH tunnel that it creates | |
remains active or gets killed according to the text value contained in a file on a remote | |
server that tells it whether to start or kill the process. | |
That file contains "on" or "off" text that is accessible via a URL. | |
On that server, the user should be able to SSH to it and change the command value in the file. |
This file contains hidden or 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
package main | |
# This decrypts a file that was encrypted with encryptor where the file name was appended with .enc | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"fmt" | |
"io/ioutil" | |
"os" |
This file contains hidden or 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
package main | |
import ( | |
"crypto/aes" | |
"crypto/cipher" | |
"crypto/rand" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"os" |
This file contains hidden or 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 _ready(): | |
if OS.get_name() == "Windows": | |
var screen_size = OS.get_screen_size() | |
var window_size = OS.get_window_size() | |
OS.set_window_position(Vector2((screen_size.x - window_size.x) * 0.5, 0)) | |
OS.set_window_size(Vector2(window_size.x, screen_size.y - 75)) # Allow for the tray bar |
This file contains hidden or 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
/* | |
* Bicyle computer Arduino Uno code | |
* Author: Andrew M Wilkes | |
* 2016-08-12 | |
*/ | |
/* | |
* Notes | |
* Switch/sensor debounce is implemented by assigning an INT value to the switch variable that is set on the initial falling edge of the switch. | |
* The switch action is then ignored until the value has been counted down to zero. |
This file contains hidden or 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 Control | |
# Scene structure: | |
# Main (Control Node) | |
# - HBox | |
# -- Multi-line Text label of 400px min width containing a bunch of text | |
# -- Control node that expands horizontally | |
# c (canvas node) | |
export var token = "#" # Marks start and end points of text to draw a line over |