Skip to content

Instantly share code, notes, and snippets.

{
"git.ignoreMissingGitWarning": true,
"workbench.colorTheme": "JetBrains Rider Dark Theme",
"editor.fontFamily": "JetBrains Mono, Consolas, 'Courier New', monospace",
"editor.fontSize": 12,
"editor.lineHeight": 20,
"editor.fontWeight": "300",
}
# coding guidelines
- follow existing coding standards, do not refactor existing coding standards to something else
- always perfer using functionality provides by libraries / tools first, introduce to libraries / tools secondary, and write custom code third unless otherwise specified
- write code in the context of that code being pushed into a production environment
- always explore simplier solutions before complicated ones
- always try existing patterns instead of introduce new ones when possible
- using naming that make code self commenting, avoid useless comment that can be easily gleaned by just reading the code
- when commenting code, only do it when needed (like for complex algorithms) or when you need to explain the why, not the what
- avoid code duplication, search for existing util methods / component to be able to re-use (it should still follow screenshot but does not need to be perfect)
@ryanzec
ryanzec / WorldSectionInitializerEntity.cs
Last active February 17, 2025 19:47
Unity custom editor from drag and drop to change the size of an area
using ProjectEdg.CoreModule;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Tilemaps;
namespace ProjectEdg.WorldModule {
[ExecuteInEditMode]
public class WorldSectionInitializerEntity : MonoBehaviour {
// other code
@ryanzec
ryanzec / index.tsx
Created February 16, 2025 19:41
cytoscape solidjs template
import styles from '$/core/components/cytoscape/cytoscape.sandbox.module.css';
import { loggerUtils } from '$/core/utils/logger';
import SandboxExamplesContainer from '$sandbox/components/sandbox-examples-container/sandbox-examples-container';
import cytoscape, { type LayoutOptions } from 'cytoscape';
import cytoscapeDagre from 'cytoscape-dagre';
import { onMount } from 'solid-js';
export default {
title: 'Components/Cytoscape',
};
@ryanzec
ryanzec / index.gd
Last active July 6, 2024 14:33
Godot Reference
# wait signle frame
await get_tree().physics_frame
# signal emit deferred
SignalManager.emit_signal.call_deferred("minimap_set_target", main_camera, 1)
(func(): SignalManager.minimap_set_target.emit(main_camera, 1)).call_deferred()
# signal connect deferred
SignalManager.minimap_set_target.connect(on_minimap_set_target, Object.CONNECT_DEFERRED)
@ryanzec
ryanzec / .editorconfig
Created August 23, 2014 21:50
My standard editor config file
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true