Skip to content

Instantly share code, notes, and snippets.

@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

@gokulkrishh
gokulkrishh / media-query.css
Last active May 5, 2024 08:25
CSS Media Queries for Desktop, Tablet, Mobile.
/*
##Device = Desktops
##Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
/* CSS */
@joshuafredrickson
joshuafredrickson / filters.php
Last active May 5, 2024 08:24
Preload font files found in Roots Sage 10 (bud.js) manifest.json
<?php
use Illuminate\Support\Str;
/**
* Add `rel="preload"` to font files found in the manifest
*/
add_filter('wp_head', function (): void {
echo collect(
json_decode(asset('manifest.json')->contents())
:: Save this as SteamTrackingFix.bat and place it in your Godot folder.
:: The name doesn't really matter, but you may need to enable viewing file extensions in Windows to save it as a batch file.
:: Run this again if Godot updates and steam tracking stops working.
@echo off
echo -----
echo Don't forget to add '/K godot.exe' to your Steam Godot Launch Options!
echo -----
:: BatchGotAdmin
:-------------------------------------
@acarril
acarril / bootable-win-on-mac.md
Created November 18, 2022 17:49
Create a bootable Windows USB using macOS

For some reason, it is surprisingly hard to create a bootable Windows USB using macOS. These are my steps for doing so, which have worked for me in macOS Monterey (12.6.1) for Windows 10 and 11. After following these steps, you should have a bootable Windows USB drive.

1. Download a Windows disc image (i.e. ISO file)

You can download Windows 10 or Windows 11 directly from Microsoft.

2. Identify your USB drive

After plugging the drive to your machine, identify the name of the USB device using diskutil list, which should return an output like the one below. In my case, the correct disk name is disk2.

@alanmsmxyz
alanmsmxyz / lemp.sh
Created September 3, 2020 07:55
Bash script to start / stop LEMP services (Nginx, MySQL, and PHP-FPM) via systemd.
#!/bin/bash
# Bash script to start / stop LEMP services (Nginx, MySQL, and PHP-FPM) via systemd.
# Usage lemp.sh [start|stop|restart]
# Check if the script run as root
if [ `whoami` != 'root' ]; then
echo "You need to run this as root"
exit
fi
@royling
royling / background.js
Last active May 5, 2024 08:08
Click Chrome extension icon to execute scripts on active tab
chrome.action.onClicked.addListener((tab) => {
chrome.scripting.executeScript({
target: {
tabId: tab.id,
},
files: ["content.js"],
});
});
@Klerith
Klerith / pasos-node-typescript.md
Last active May 5, 2024 08:06
Configurar proyecto de Node con TypeScript

Pasos para usar Node con TypeScript con Nodemon

Más información - Docs Oficiales

  1. Instalar TypeScript y tipos de Node, como dependencia de desarrollo
npm i -D typescript @types/node
  1. Inicializar el archivo de configuración de TypeScript ( Se puede configurar al gusto)