Skip to content

Instantly share code, notes, and snippets.

@dmlary
dmlary / main.rs
Last active May 5, 2024 08:41
minimal example of adding a custom render pipeline in bevy 0.11
/// minimal example of adding a custom render pipeline in bevy 0.11.
///
/// When this example runs, you should only see a blue screen. There are no
/// vertex buffers, or anything else in this example. Effectively it is
/// shader-toy written in bevy.
///
/// This revision adds a post-processing node to the RenderGraph to
/// execute the shader. Thanks to @Jasmine on the bevy discord for
/// suggesting I take a second look at the bevy post-processing example
///
@nadavrot
nadavrot / Matrix.md
Last active May 5, 2024 08:37
Efficient matrix multiplication

High-Performance Matrix Multiplication

This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).

Intro

Matrix multiplication is a mathematical operation that defines the product of

// Poll example Discord.js V14.15.1
import { PollData } from 'discord.js';
const poll: PollData = {
question: {
text: 'PHP is good?',
},
answers: [
{
@janasco
janasco / AnyDesk-Reset.cmd
Created August 3, 2023 09:46
AnyDesk Reset
@echo off & setlocal enableextensions
title Reset AnyDesk
reg query HKEY_USERS\S-1-5-19 >NUL || (echo Please Run as administrator.& pause >NUL&exit)
chcp 437
call :stop_any
del /f "%ALLUSERSPROFILE%\AnyDesk\service.conf"
del /f "%APPDATA%\AnyDesk\service.conf"
copy /y "%APPDATA%\AnyDesk\user.conf" "%temp%\"
rd /s /q "%temp%\thumbnails" 2>NUL
xcopy /c /e /h /r /y /i /k "%APPDATA%\AnyDesk\thumbnails" "%temp%\thumbnails"
@jancumps
jancumps / pwm.vhd
Last active May 5, 2024 08:28
vhdl PWM with dead band. Based on PWM example code from XESS Corp
--**********************************************************************
-- Copyright (c) 2011-2014 by XESS Corp <http://www.xess.com>.
-- All rights reserved.
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
-- License as published by the Free Software Foundation; either
-- version 3.0 of the License, or (at your option) any later version.
--
-- This library is distributed in the hope that it will be useful,
@LeoVerto
LeoVerto / signal-rest.yaml
Created October 4, 2022 18:21
CrowdSec alert to signal-cli-rest-api
type: http
name: signal-rest
log_level: info
group_wait: 30s
format: |
{
"number": "SENDER_NUMMER",
@mennwebs
mennwebs / th-address.json
Created November 20, 2023 02:16
Thai Address from Postal Code - JSON
This file has been truncated, but you can view the full file.
[
{
"zipCode": "10100",
"subDistrictList": [
{
"subDistrictId": "100801",
"districtId": "1008",
"provinceId": "10",
"subDistrictName": "ป้อมปราบ"
},
@wojteklu
wojteklu / clean_code.md
Last active May 5, 2024 08:26
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