Skip to content

Instantly share code, notes, and snippets.

@MariaSolOs
MariaSolOs / builtin-compl.lua
Last active June 30, 2024 05:22
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)
@VPraharsha03
VPraharsha03 / kitty-in-wsl2.md
Last active June 21, 2024 23:14 — forked from Mluckydwyer/opengl-in-wsl.md
Install kitty on Ubuntu in WSL2

How to Install kitty in Ubuntu in WSL2

These seteps have been tested on Windows 10 with WSL2 running Kali Linux.

1. Dependencies

First install the dependencies:

Install OpenGL

apt install mesa-utils libglu1-mesa-dev freeglut3-dev mesa-common-dev
@sts10
sts10 / rust-command-line-utilities.markdown
Last active July 5, 2024 06:17
A curated list of command-line utilities written in Rust

A curated list of command-line utilities written in Rust

Note: I have moved this list to a proper repository. I'll leave this gist up, but it won't be updated. To submit an idea, open a PR on the repo.

Note that I have not tried all of these personally, and cannot and do not vouch for all of the tools listed here. In most cases, the descriptions here are copied directly from their code repos. Some may have been abandoned. Investigate before installing/using.

The ones I use regularly include: bat, dust, fd, fend, hyperfine, miniserve, ripgrep, just, cargo-audit and cargo-wipe.

  • atuin: "Magical shell history"
  • bandwhich: Terminal bandwidth utilization tool
@mafintosh
mafintosh / promise-unhandled-why.js
Last active March 30, 2022 06:30
promise-unhandled-why.js
start()
async function start () {
const promises = [
new Promise((resolve, reject) => setTimeout(reject, 1000)),
Promise.reject(),
Promise.reject()
]
for (const a of promises) {
using namespace System.Management.Automation
using namespace System.Management.Automation.Language
if ($host.Name -eq 'ConsoleHost')
{
Import-Module PSReadLine
}
#Import-Module PSColors
#Import-Module posh-git
Import-Module -Name Terminal-Icons
@danilosetra
danilosetra / pseudo-elements.md
Created March 27, 2021 03:47 — forked from alwayrun/pseudo-elements.md
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@LukeMathWalker
LukeMathWalker / audit.yml
Last active July 2, 2024 15:09
GitHub Actions - Rust setup
name: Security audit
on:
schedule:
- cron: '0 0 * * *'
push:
paths:
- '**/Cargo.toml'
- '**/Cargo.lock'
jobs:
security_audit:
@superjojo140
superjojo140 / postgresql_arch_tutorial.md
Created December 4, 2019 09:56
Setup local PostgreSQL and pgAdmin on ArchLinux

Working with local PostgreSQL and pgAdmin on ArchLinux

Daily Usage

Start postgreSQL

$ sudo systemctl start postgresql
@tarusharora
tarusharora / auth.js
Created February 19, 2019 08:00
Auth Validations for sign-up and sign-in
const nconf = require('nconf');
const userPasswordRegex = nconf.get('userPasswordRegex');
const validatePostLogin = {
schema: {
body: {
type: 'object',
properties: {
email: { type: 'string', format: 'email' },