Skip to content

Instantly share code, notes, and snippets.

@rvrsh3ll
rvrsh3ll / windows-keys.md
Created February 18, 2024 22:44
Windows Product Keys

NOTE

These are NOT product / license keys that are valid for Windows activation.
These keys only select the edition of Windows to install during setup, but they do not activate or license the installation.

Index

local M = {
"neoclide/coc.nvim",
branch = "master",
build = "yarn install --frozen-lockfile",
}
M.config = function()
-- Some servers have issues with backup files, see #649
vim.opt.backup = false
vim.opt.writebackup = false
@nathandaly
nathandaly / BaseResource.php
Last active May 15, 2024 20:19
Tenancy for Laravel & Filament V3 (Tenant per database)
<?php
/**
* Below is an the extended Filament resource your tenant panel resources
* will have to extend so that the queries are scoped properly.
*/
namespace App\Filament;
use Filament\Resources\Resource;
@hellerbarde
hellerbarde / latency.markdown
Created May 31, 2012 13:16 — forked from jboner/latency.txt
Latency numbers every programmer should know

Latency numbers every programmer should know

L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns             
Compress 1K bytes with Zippy ............. 3,000 ns  =   3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns  =  20 µs
SSD random read ........................ 150,000 ns  = 150 µs

Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs

@SirBaeK
SirBaeK / README.md
Created May 15, 2024 20:17 — forked from peedy2495/README.md
Deploy USB-devices via Network as simple and stable as possible

Deploy USB-devices via Network as simple and stable as possible

Features:

  • auto-export on host when a defined usb-device has been plugged
  • auto-attachment on client when a disappeared remote-device is available, again.

Files Included:

README.md
usbip-export@.service

@peedy2495
peedy2495 / README.md
Last active May 15, 2024 20:17
Deploy USB-devices via Network as simple and stable as possible

Deploy USB-devices via Network as simple and stable as possible

Features:

  • auto-export on host when a defined usb-device has been plugged
  • auto-attachment on client when a disappeared remote-device is available, again.

Files Included:

README.md
usbip-export@.service

@Xiol
Xiol / README.md
Last active May 15, 2024 20:13
Extend Gitlab access token expiry dates

Extend Gitlab Access Tokens

Gitlab enforced token expiry limits to 365 days last year, and the time is now upon us.

They don't have an opt-out for this, and haven't provided a way to easily extend tokens in the web interface. They have also gated their credential management interface behind their Ultimate license.

This quickly thrown together script will allow you to add an extra year to all tokens that expire in the next 30 days. It will not reactivate tokens that have already expired.

Requires the python-gitlab module. Edit your self-hosted Gitlab instance details into the script and run it. It will dump out CSVs of all expiring tokens, and then dump out a list of commands you can paste into a gitlab-rails console session to extend the expiry date by another year. If you need them to be active for longer, change 1.year.from_now to the value of your choice, e.g. `10.years.fro

@JoeyBurzynski
JoeyBurzynski / 55-bytes-of-css.md
Last active May 15, 2024 20:11
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@MagallanesFito
MagallanesFito / Floyd-Warshall.cpp
Created May 4, 2017 07:39
Floyd-Warshall Graph Algorithm C++
#include <iostream>
#define INF 0x3f3f3f3f
#define MAX_VERTICES 4
using namespace std;
int graph[MAX_VERTICES][MAX_VERTICES] = {
{0,5,INF,10},
{INF,0,3,INF},
{INF,INF,0,1},
{INF,INF,INF,0}
@bradtraversy
bradtraversy / terminal-commands.md
Last active May 15, 2024 20:09
Common Terminal Commands

Common Terminal Commands

Key Commands & Navigation

Before we look at some common commands, I just want to note a few keyboard commands that are very helpful:

  • Up Arrow: Will show your last command
  • Down Arrow: Will show your next command
  • Tab: Will auto-complete your command
  • Ctrl + L: Will clear the screen