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 raycast(camera: Camera3D): | |
var rayOrigin = camera.project_ray_origin(get_viewport().get_mouse_position()) | |
var query = PhysicsRayQueryParameters3D.create(rayOrigin, rayOrigin + camera.project_ray_normal(get_viewport().get_mouse_position()) * 200); | |
return camera.get_world_3d().direct_space_state.intersect_ray(query) |
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
using System; | |
public class Program | |
{ | |
public static void Main() | |
{ | |
var index = 0; | |
var arr = new int[] { 1, 2, 3, 4 }; | |
for(int i = 0; i < 20; i++) { |
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 script loads and registers store modules automagically from the same folder. | |
* | |
* Assuming following setup: | |
* src/store-modules/index.ts | |
* src/store-modules/ui-store.ts | |
* | |
* Produces: | |
* store | |
* store/ui |
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 Node2D | |
# These helper functions smoothly look at any object in 2D space. | |
# To avoid wrong rotations over +180 degrees, lerp_angle is used. | |
# Everything happens in global space, so the rotations should be applied properly. | |
func _process(delta): | |
$icon.global_rotation = look_at_position($icon, get_global_mouse_position(), 5.0 * delta) | |
func look_at_position(source: Node2D, target: Vector2, delta: float): |
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
docker network create -d bridge internal-network | |
docker pull postgres | |
docker run --network=internal-network --name postgres-db --publish 5432:5432 -e POSTGRES_PASSWORD=root -d postgres |
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
docker network create -d bridge internal-network | |
docker pull mysql | |
docker run --network=internal-network -p 3306:3306 --name mysql-db -e MYSQL_ROOT_PASSWORD=root -e MYSQL_ROOT_HOST=% -d mysql |
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 Panel | |
# Add this script to a panel node | |
# Panel <-- contains script | |
# |- Page1 | |
# |--Button <-- calls get_node("../../").transitionTo("Page2") | |
# |- Page2 | |
# |--Button <-- calls get_node("../../").transitionTo("Page1") | |
var old_ui : Control |
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
using System; | |
using System.Collections.Generic; | |
// Author: NovemberDev | |
public class Program | |
{ | |
/// | |
/// TreeNode baseclass | |
/// |
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 KinematicBody2D | |
const HALT_SPEED = 0.325 | |
const MAX_SPEED = 750.0 | |
const GRAVITY = 1200.0 | |
const MAX_JUMP = 725.0 | |
const MAX_JUMP_TIME = 1.5 | |
const MAX_JUMP_FORGIVENESS_TIME = 0.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
public static bool IsEven(int i) { | |
return (i & 1) == 0; | |
} | |
/* | |
Returns if the given integer is even using Bitwise & AND operator: | |
1010 equals 10 in decimal | |
0001 equals 1 in decimal | |
0000 AND returns 0 so it is even (0 of 10, 1 of 1) |
NewerOlder