Skip to content

Instantly share code, notes, and snippets.

View king-11's full-sized avatar
🎯
Targeting

Lakshya Singh king-11

🎯
Targeting
View GitHub Profile
@edmundsmith
edmundsmith / langfeatures.md
Created November 22, 2021 14:42
Things I wish $Lang had

Things I wish $Lang had

Sometimes, when programming, I notice that I'm missing some useful features, or when reading I think 'this would be really useful to be part of $Lang'.

Explicit order-invariance and synchronisation points

C compilers are part of why C is hard. They re-order statements based on what appears to be a magic black box. Understanding what's in that black box is much harder than it should be. Many statements (or expressions) in programming act completely independently of each other, and thus their order of execution should not matter. Meanwhile, other statements can depend on the execution of a previous statement (/expression). It would be nice to see the execution dependency graph explicitly and syntactically laid out, rather than being inferred from analysis or assuming every statement to induce a synchronisation point.

Some languages get part of this right. Haskell's laziness means order of execution doesn't need to match the order it's written down, and its purity means that orde

@mp035
mp035 / laravel-ajax-form.js
Last active October 5, 2022 22:14
Convert any standard HTML form to ajax by adding a few classes to the components and including this file. (see comments)
// notes on using this file:
// This file is intended to work with a standard html form the same as what you use for server side rendered laravel projects.
// The only changes you need to make to the form are:
// 1. Add the class "ajax-submit" to any form you want to be submitted via ajax.
// 2. If you have a "Cancel" button on your form, mark it with the class "form-cancel"
// 3. Add a bootstrap alert in your form, marked with the class "ajax-error-alert" and "collapse" (to keep it initally hidden). This alert will display any error messages.
// Then call the function "AttachAjaxSubmit()" after the DOM is loaded.
// NOTE: This script requires bootstrap to style the components during the submission process.
@krisleech
krisleech / renew-gpgkey.md
Last active May 5, 2024 10:26
Renew Expired GPG key

Renew GPG key

Given that your key has expired.

$ gpg --list-keys
$ gpg --edit-key KEYID

Use the expire command to set a new expire date: