Skip to content

Instantly share code, notes, and snippets.

@patotoma
patotoma / ContactForm.md
Last active October 7, 2023 07:39
secure php contact form

Secured PHP Contact Form

<?php
  if(isset($_POST['submit'])){
    $name = htmlspecialchars(stripslashes(trim($_POST['name'])));
    $subject = htmlspecialchars(stripslashes(trim($_POST['subject'])));
    $email = htmlspecialchars(stripslashes(trim($_POST['email'])));
    $message = htmlspecialchars(stripslashes(trim($_POST['message'])));
    if(!preg_match("/^[A-Za-z .'-]+$/", $name)){
@xero
xero / irc.md
Last active August 15, 2025 16:43
irc cheat sheet
@ErkHal
ErkHal / Steam on Arch Linux - Switch Pro Controller configuration.md
Created April 25, 2019 16:11
(Hopefully) helpful instructions about using a Switch Pro controller with Steam client on Arch Linux

Steam for Arch Linux - Switch Pro Controller Configuration (Wired)

The following instructions are based on a reddit comment of u/zolixes and cleaned up/modified by me.

The following has been tested to work with:

  • Arch Linux with kernel version 5.0.9
  • Steam build jenkins-steam-runtime-beta-release_0.20190320.2 (As seen from Help -> System Information -> Steam Runtime Version)

There is a file: /lib/udev/rules/99-steam-controller-perms.rules (if no rules related to steam are found install the steam-devices package and this file will appear).

NOTE: The file might be named differently and the number in front of it can differ from the example. In my case this was:

@MariaSolOs
MariaSolOs / builtin-compl.lua
Last active August 1, 2025 11:50
Built-in completion + snippet Neovim setup
---Utility for keymap creation.
---@param lhs string
---@param rhs string|function
---@param opts string|table
---@param mode? string|string[]
local function keymap(lhs, rhs, opts, mode)
opts = type(opts) == 'string' and { desc = opts }
or vim.tbl_extend('error', opts --[[@as table]], { buffer = bufnr })
mode = mode or 'n'
vim.keymap.set(mode, lhs, rhs, opts)