Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View stelabouras's full-sized avatar
😎

Stelios Petrakis stelabouras

😎
View GitHub Profile
@q3k
q3k / hashes.txt
Last active April 14, 2024 17:11
liblzma backdoor strings extracted from 5.6.1 (from a built-in trie)
0810 b' from '
0678 b' ssh2'
00d8 b'%.48s:%.48s():%d (pid=%ld)\x00'
0708 b'%s'
0108 b'/usr/sbin/sshd\x00'
0870 b'Accepted password for '
01a0 b'Accepted publickey for '
0c40 b'BN_bin2bn\x00'
06d0 b'BN_bn2bin\x00'
0958 b'BN_dup\x00'
@charles-l
charles-l / collision.py
Last active April 1, 2024 21:35
Simple collisions for action games (raylib python). Blog post: https://c.har.li/e/2024/03/28/implementing-robust-2D-collision-resolution.html
# `pip install raylib` to get pyray
import pyray as rl
from dataclasses import dataclass
import random
from typing import Optional
SIZE = 32
def copy_rect(rect):
@OrionReed
OrionReed / dom3d.js
Last active April 23, 2024 06:46
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@loreanvictor
loreanvictor / RISS.md
Last active March 16, 2024 09:32
Interaction as Content

Can We Get More Decentralised Than The Fediverse?

I guess that the [fediverse][fediverse] will be as decentralised as email: a bit, but not that much. Most people will be dependent on a few major hubs, some groups might have their own hubs (e.g. company email servers), personal instances will be pretty rare. This is in contrast to personal blogging, where every Bob can easily host their own (and they often do). I mean that's already implied by the name: fediverse is [a federated universe, not a distributed one][fed-v-dis].

Why does this matter? Well I like not being dependent on one entity, but I would like it much more if I was dependent on no entities at all. In other words, I like to publish my own personal blog and get all the goodies of a social network, without being dependent on other micro-blogging / social content platforms.

So in this writing, I'm going to:

  • ❓ Contemplate on why the fediverse gets federated not distributed (spoilers: its push vs pull)
  • 🧠 Ideate on how could we get a distri
@cote
cote / gist:075e2543f9ba716966cfefc86a577b12
Last active April 2, 2024 05:08
How to use AI for B2B by learning playing D&D - Part 01: Goblin Arrows
How to use AI for B2B by learning playing D&D - Part 01: Goblin Arrows
Can ChatGPT be a good Dungeons Master for Dungeons and Dragons? How can you use ChatGPT for B2B marketing and strategy? These are the two questions I’m figuring out by learning how to play D&D in generative AI tools.
In this first episode, the ChatDM and I start cold with the classic Goblin Arrows chapter in The Lost Mines of Phandelver.
See my notes here:
https://gist.github.com/cote/075e2543f9ba716966cfefc86a577b12/edit

Preface

I'm comparing Godot mostly to Unity due to my ~10 years of Unity experience. I'm also primarily working in 3D and C# and that is what I want to use Godot for.

Terms:

  • by "export" I mean a variable exposed in the inspector, that's how Godot calls them
  • I use the word "prefab" to mean a scene that is intended to be instantiated multiple times, unlike a "level"
  • Godot's Resources == Unity's ScriptableObjects
  • Godot's collision shapes == Unity's colliders

Pros

@snej
snej / missing_includes.rb
Created October 2, 2023 16:19
Script to find missing std #includes in C++ headers
#! /usr/bin/env ruby
#
# missing_includes.rb
# By Jens Alfke <jens@couchbase.com>
# Version 2.0 -- 2 Oct 2023
# Copyright 2021-Present Couchbase, Inc.
#
# This script scans C++ header files looking for usage of common standard library classes, like
# `std::vector`, without including their corresponding headers, like `<vector>`. It similarly looks
# for standard C functions like `strlen` that are used without including their header (`<cstring>`.)
@Donnotron666
Donnotron666 / EdgeMap.hlsl
Created September 24, 2023 17:27
Consume Edge Maps on the GPU
void getSpriteEdges_float(UnityTexture2D edgeMap, UnitySamplerState ss, float2 uv, out float top, out float right, out float left, out float bot) {
//MY COUNTERPART IS EdgeMapUtils.GetEdge
float4 color = edgeMap.Sample(ss, uv);
top = color.r;
right = color.g;
left = color.b;
bot = color.a;
@Donnotron666
Donnotron666 / EdgeMapUtils.cs
Created September 24, 2023 17:25
CPU-Based Edge Detection
using System;
using System.Collections.Generic;
using System.Linq;
using UnityEditor;
using UnityEngine;
namespace Editor.Utility
{
public static class EdgeMapUtils
{

During the past days, this great article by Sam Pruden has been making the rounds around the gamedev community. While the article provides an in-depth analysis, its a bit easy to miss the point and exert the wrong conclusions from it. As such, and in many cases, users unfamiliar with Godot internals have used it points such as following:

  • Godot C# support is inefficient
  • Godot API and binding system is designed around GDScript
  • Godot is not production ready

In this brief article, I will shed a bit more light about how the Godot binding system works and some detail on the Godot