Skip to content

Instantly share code, notes, and snippets.

@albertms10
albertms10 / graphNodes.md
Last active April 5, 2025 14:20
Graph Nodes in TypeScript

Graph Nodes in TypeScript

Description

In the process of implementing a basic graph system with nodes that point to other nodes (node → node) using an identifier code, we got to this simple but acceptable solution:

interface GraphNode {
  code: number;
  next: number | null;
@sunmeat
sunmeat / index.html
Created April 5, 2025 14:18
особенности функций
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
@tegila
tegila / wireguard.md
Created October 7, 2021 20:53 — forked from dockerlead/Tutorial.md
Wireguard on CentOS 7/8

Set Up Your Own WireGuard VPN Server on CentOS

This tutorial is going to show you how to set up your own WireGuard VPN server on CentOS. WireGuard is made specifically for the Linux kernel. It runs inside the Linux kernel and allows you to create fast, modern, and secure VPN tunnel. TL;DR

Prerequisites

This tutorial assumes that the VPN server and VPN client are both running CentOS operating system.

Step 1: Install WireGuard on CentOS Server and Desktop

Log into your CentOS server, then run the following commands to install WireGuard.

# CentOS 8
@danstarns
danstarns / complexity.js
Last active April 5, 2025 14:16
graphql-depth-apollo-server
const gqlComplexity = require("graphql-query-complexity");
const { UserInputError } = require("apollo-server");
const { separateOperations } = require("graphql");
const MAX_DEPTH = 10;
const estimators = [
gqlComplexity.fieldExtensionsEstimator(),
gqlComplexity.directiveEstimator(),
gqlComplexity.simpleEstimator({ defaultComplexity: 1 })
@dtr2300
dtr2300 / nvim-events.md
Last active April 5, 2025 14:15
Overview of Nvim Events

Nvim Events

Nvim recognizes the following events. Names are case-insensitive.

BufAdd
Just after creating a new buffer which is
added to the buffer list, or adding a buffer
@gpoole
gpoole / README.md
Last active April 5, 2025 14:14
Xen/XCP-ng script to attach physical USB devices via passthrough to a VM

XCP-ng USB passthrough tools

A set of command line tools and a service to make setting up passthrough USB devices easier:

  • add-custom-usb-policies - script to store and apply custom USB policies required for specific devices
  • attach-usb-devices - script and service to automatically connect USB devices to VMS when XCP-ng boots up
  • plug-usb - attach a physical USB device to a VM in one command
  • unplug-usb - remove a physical USB device from a VM in one command

To set up, copy the files onto your server and run install.sh to copy everything and set up the service.

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active April 5, 2025 14:05
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized
@sunmeat
sunmeat / index.html
Created April 5, 2025 14:01
loops in javascript
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/icon.svg" type="image/svg+xml">
@sunmeat
sunmeat / index.html
Created April 5, 2025 13:55
Math.random()
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title></title>
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="/favicon.ico" sizes="any">
<link rel="icon" href="/icon.svg" type="image/svg+xml">