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 Node | |
func _ready() -> void: | |
var values | |
# Bad setup: prints {a:40, b:42} | |
values = { "a": 0, "b": 0 } | |
for idx in range(0, 100): | |
values["a" if randf() > 0.9 else "b"] += 1 | |
print(values) |
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 Node | |
signal load_finished(path) | |
signal load_stage(path, stage, total) | |
var loader : Thread | |
var mutex : Mutex | |
var ready : Semaphore | |
var resources = {} | |
var queued = [] |
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
shader_type canvas_item; | |
render_mode blend_mix; | |
uniform vec4 color_1 = vec4(0.784313725, 0.788235294, 0.262745098, 1.0); | |
uniform vec4 color_2 = vec4(0.490196078, 0.521568627, 0.152941176, 1.0); | |
uniform vec4 color_3 = vec4(0.000000000, 0.415686275, 0.000000000, 1.0); | |
uniform vec4 color_4 = vec4(0.015686275, 0.243137255, 0.000000000, 1.0); | |
uniform float offset = 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
#!env sh | |
FILES="$(find -type f -name *.tscn)" && sed -i "/^editor\/display_folded/d" -- $FILES && sed -i "/^_sections_unfolded/d" -- $FILES && sed -i '/^\[node /s/ index="0"//g' -- $FILES |
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
<?php | |
namespace Berny\Symfony\Routing; | |
use Symfony\Component\Config\Loader\FileLoader; | |
use Symfony\Component\Config\Resource\FileResource; | |
use Symfony\Component\Routing\RouteCollectionBuilder; | |
final class PhpArrayRouteLoader extends FileLoader | |
{ |
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
<?php | |
use Iterator; | |
use IteratorAggregate; | |
final class CachedIterator implements IteratorAggregate | |
{ | |
private $cached; | |
private $iterator; |
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 Area2D | |
func _ready(): | |
if get_tree().is_editor_hint(): | |
return | |
#old_workaround() | |
fixed_workaround() | |
func fixed_workaround(): | |
var children = get_children() |
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
<?php // Full license: https://gist.github.com/xphere/710839fba51cdd582ebd4ddf635cc0c4 | |
use DateTimeImmutable as Time; | |
final class Watch | |
{ | |
/** @var Time|null */ | |
private static $frozenTime = null; | |
public static function fromFormat($dateString, $format = 'Y-m-d H:i:s'): Time |
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
<?php | |
use Composer\Script\Event; | |
class PathDumper | |
{ | |
static $defaults = [ | |
'symfony-app-dir' => 'boot', | |
'symfony-bin-dir' => 'bin', | |
'symfony-config-dir' => 'etc', |
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
#! /bin/bash | |
function git() { | |
CMD= | |
PARAMS= | |
if [[ $# -gt 0 ]]; then | |
CMD="$1" | |
shift | |
case "$CMD" in | |
"fetch") |