Skip to content

Instantly share code, notes, and snippets.

@velzend
velzend / reolinkRotateCertificate.py
Last active January 3, 2025 22:14
Reolink doorbell refresh certificates using Lego (ACME) and the API
#!/usr/bin/env python3
"""
I wanted to replace the self-signed certificate with one signed by Let's Encrypt, and
did not want to perform this action manually.
I asked Reolink technical support, but they answered there is no API to manage certificates.
So I did some research and found the Reolink doorbell camera and probably other models
do support to upload your own certificates.
@FuzzysTodd
FuzzysTodd / tenderly...project...WETH10.sol
Created January 3, 2025 22:13
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.26+commit.4563c3fc.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.4.10;
contract WETH9 {
string public name = "Wrapped Ether";
string public symbol = "WETH";
uint8 public decimals = 18;
@cazador481
cazador481 / .ctags
Created November 27, 2013 03:23
.ctags for system verilog
--langdef=systemverilog
--langmap=systemverilog:.sv.svh.svi.v
--regex-systemverilog=/^\s*(\b(static|local|virtual|protected)\b)*\s*\bclass\b\s*(\b\w+\b)/\3/c,class/
--regex-systemverilog=/^\s*(\b(static|local|virtual|protected)\b)*\s*\btask\b\s*(\b(static|automatic)\b)?\s*(\w+::)?\s*(\b\w+\b)/\6/t,task/
--regex-systemverilog=/^\s*(\b(static|local|virtual|protected)\b)*\s*\bfunction\b\s*(\b(static|automatic)\b)?\s*\b\w+\b(\s*\[.+\])*\s*(\w+::)?\s*(\b\w+\b)/\7/f,function/
--regex-systemverilog=/^\s*\bmodule\b\s*(\b\w+\b)/\1/m,module/
--regex-systemverilog=/^\s*\bprogram\b\s*(\b\w+\b)/\1/p,program/
--regex-systemverilog=/^\s*\binterface\b\s*(\b\w+\b)/\1/i,interface/
--regex-systemverilog=/^\s*\btypedef\b\s+.*\s+(\b\w+\b)\s*;/\1/e,typedef/
@pascalduez
pascalduez / SassMeister-input.scss
Last active January 3, 2025 22:09
Some Sass string functions: capitalize, ucwords, camelize, ...
// ----
// Sass (v3.3.4)
// Compass (v1.0.0.alpha.18)
// ----
// Capitalize string
// --------------------------------------------------------------------------------
// @param [string] $string
// --------------------------------------------------------------------------------
// @return [string]
@Kaoschuks
Kaoschuks / wfc-simple-tiled.ts
Created September 28, 2023 20:02 — forked from joshuamorony/wfc-simple-tiled.ts
A TypeScript implementation based on Robert Heaton's "Even Simpler Tiled Model" of the Wave Function Collapse algorithm
type Tile = number;
type TileOrientation = 0 | 90 | 180 | 270;
export type TileMapping = Record<number, number>;
type Coordinates = [number, number];
enum DirectionKeys {
UP = 'UP',
DOWN = 'DOWN',
LEFT = 'LEFT',
@cuonggt
cuonggt / markdown_guide.md
Last active January 3, 2025 22:08
The Ultimate Guide to Markdown

Markdown Guide

The Ultimate Guide to Markdown

Basic Markdown Formatting

Headings

# This is an <h1> tag

This is an tag

@uddhabh
uddhabh / onetab-delete-all.js
Last active January 3, 2025 22:02
OneTab delete all saved tabs script
// https://intuitive-theory.com/notes/onetab-delete-all-saved-tabs-script/
function delete_single() {
for (clickable of clickables) {
if (!clickable || clickable.innerHTML !== "Delete all")
continue;
clickable.click();
return true;
}
return false;
}
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active January 3, 2025 22:00
set -e, -u, -o, -x pipefail explanation
@khromov
khromov / bundle-size.yaml
Last active January 3, 2025 21:58
GitHub Actions Bundle size comparison
name: 'Bundle Size Comparison'
on:
pull_request:
branches:
- master
jobs:
build:
runs-on: ubuntu-latest
@flga
flga / odin-gdb-pretty-printers.py
Last active January 3, 2025 21:56
GDB pretty printers for Odin types
import gdb
import gdb.printing
import re
# allow to manually reload while developing
objfile = gdb.current_objfile() or gdb.objfiles()[0]
objfile.pretty_printers = []
class OdinStringPrinter:
"Pretty print Odin strings."