Skip to content

Instantly share code, notes, and snippets.

@williamd1k0
williamd1k0 / EditorIconTexture.gd
Created May 6, 2024 23:46
Helper Texture class to use Godot Editor icons in plugins, such as main screen plugins.
@tool
class_name EditorIconTexture
extends AtlasTexture
var icon :String:
set(val):
icon = val
_update_icon.call_deferred()
func _init():
@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 21:18
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@alfredkrohmer
alfredkrohmer / list-user-installed-packages.sh
Created February 11, 2017 13:39
List all user-installed packages on OpenWrt / LEDE
#!/bin/sh
FLASH_TIME=$(opkg info busybox | grep '^Installed-Time: ')
for i in $(opkg list-installed | cut -d' ' -f1)
do
if [ "$(opkg info $i | grep '^Installed-Time: ')" != "$FLASH_TIME" ]
then
echo $i
fi
@michaeltreat
michaeltreat / psql_wsl_install.md
Last active May 7, 2024 21:14
Postgres WSL install instructions

Install psql on WSL

Home

This install is pretty different from previous versions of psql install instructions for windows. This install uses the WSL and Ubuntu shell.

We are installing this through the Ubuntu command line which is different from the other Ubuntu install instructions because those instructions use Ubuntu's GUI, which we don't have access to here.

NOTE: Since this is a service that is running on Ubuntu, you should be in the the Ubuntu file system when running these commands!

Install

@StagPoint
StagPoint / CameraMath.cs
Created December 2, 2020 23:20
Small collection of utility functions for calculating screen size of objects, size of camera frustum at a distance, etc.
using System;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using Unity.Burst;
using Unity.Mathematics;
public static class CameraMath
{
/// <summary>
@StagPoint
StagPoint / TriangleBoxIntersect.cs
Last active May 7, 2024 21:14
Triangle/AABB Intersection Test in C#
public static bool IntersectsBox( Vector3 a, Vector3 b, Vector3 c, Vector3 boxCenter, Vector3 boxExtents )
{
// From the book "Real-Time Collision Detection" by Christer Ericson, page 169
// See also the published Errata at http://realtimecollisiondetection.net/books/rtcd/errata/
// Translate triangle as conceptually moving AABB to origin
var v0 = ( a - boxCenter );
var v1 = ( b - boxCenter );
var v2 = ( c - boxCenter );
@AshtakaOOf
AshtakaOOf / gui.md
Last active May 7, 2024 21:13
Stable Diffusion GUI list

Stable Diffusion GUIs list

This will help me and hopefully other to get everything going and generate waifus images with Stable Diffusion, and maybe other txt2img things maybe.

I will probably add shields.io to make it more easier to read (maybe)

Tip

Check out the SD Anime Checkpoints list.

  • Glossary
@mcxiaoke
mcxiaoke / miui-blotware-apps.md
Last active May 7, 2024 21:12
MIUI 13/14 bloatware apps, updated at 20240816

对于所有应用,不建议直接删除,使用adb shell pm disable-user package-name禁用即可,方便出问题时恢复。

DO NOT UNINSTALL:

  • com.miui.securitycenter
  • com.miui.securityadd
  • com.xiaomi.finddevice

(Don’t uninstall these three apps or services from your Xiaomi device. Otherwise, you may encounter device bricking or bootloop issues.)

@pugliathomas
pugliathomas / user_customprompts.json
Last active May 7, 2024 21:12
ChatGPT custom prompts #ai
[
{
"cmd": "pwsh_gen",
"act": "pwsh_gen",
"enable": true,
"prompt": "I am going to only ask you about PowerShell code and script questions only. Your task is to provide me no matter what the question is a reply that can be solved in PowerShell. "
},
{
"cmd": "emp_thumbnail",
"act": "emp_thumbnail",

Transparent Restaurant Backend

In this task, you're going to implement a REST API for a interacting with a menu of a restaurant. The menu is given to you as a JSON file which you will parse and perform operations on. The required features will be listed below.

Description

In this restaurant, honesty is extremely promoted. So extreme, that the restaurant declares that differing quality of ingredients are used in their meals. Like that's not enough, it also allows the customers to choose the ingredients of each meal in different qualities. Each ingredient has the following quality levels:

  • low: the cheapest
  • medium: moderate