Skip to content

Instantly share code, notes, and snippets.

@DseidLi
DseidLi / download_csdn_article.js
Created May 12, 2024 21:06
使用JavaScript提取CSDN文章并保存为HTML文件
// 打开一个新窗口以便于存放和显示提取的内容
var newWin = window.open('', '_blank');
// 提取带有'blog-content-box'类的元素的HTML内容
var contentBox = document.querySelector('.blog-content-box').outerHTML;
// 获取标题用于文件名
var articleTitle = document.querySelector('#articleContentId').innerText.trim();
var fileName = articleTitle.replace(/[\/\\:*?"<>|]/g, '_') + '.html'; // 清理文件名中的非法字符
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active May 12, 2024 21:06
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@Jozo132
Jozo132 / float32encoding.js
Last active May 12, 2024 21:04
JavaScript (Node.js) IEEE 754 Single precision Floating-Point (32-bit) binary conversion from and to both Hex and Bin
/* ##### float32encoding.js #####
MIT License
- Forked 'toFloat' from https://gist.github.com/laerciobernardo/498f7ba1c269208799498ea8805d8c30
- Forked 'toHex' from stackoverflow answer https://stackoverflow.com/a/47187116/10522253
- Modifyed by: Jozo132 (https://github.com/Jozo132)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
@eNV25
eNV25 / hp-bios-update.md
Last active May 12, 2024 21:00
Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

Instructions to Update the BIOS/UEFI for an HP Laptop on Linux

To update the BIOS/UEFI firmware requires HP-specific files in the EFI System Partition, also referred to as ESP.

On a Linux system, the ESP is typically mounted on /boot/efi or /efi. Whithin you should also find a EFI directory, e.g. /boot/efi/EFI or /efi/EFI. This article assumes that the ESP is mounted on /efi and that the /efi/EFI directory exists. You can replace that with the mount point your system uses.

The HP-specific files are located in /efi/EFI/HP or /efi/EFI/Hewlet-Packard. These files typically come preinstalled in HP Windows PCs. If you have these files you could skip Install HP-specific files.

@kipester
kipester / relocatelibvirtimages.md
Created May 12, 2024 20:58 — forked from plembo/relocatelibvirtimages.md
Relocate kvm images directory

Relocate an existing libvirtd (KVM) images directory

By default, KVM (libvirtd) images on Ubuntu and most other Linux distributions are found in /var/lib/libvirt/images. This can be inconvenient if you don't have a separate /var partition that can grow over time to accommodate multiple large images.

You can simply rename the images folder to something else and then symlink to a larger space with it (e.g. ln -s /data1/libvirt/images /var/lib/libvirt/images). That's what I used to do.

But that can lead to all sorts of unanticipated trouble. The right way to have your images on a bigger disk is to change the path for libvirt's default storage pool to a partition on that big disk, which is logically where KVM is going to create them.

First check to make sure a default pool exists:

@aamiaa
aamiaa / CompleteDiscordQuest.md
Last active May 12, 2024 20:58
Complete Recent Discord Quest

Complete Recent Discord Quest

Note

This no longer works in browser!

Note

This no longer works if you're alone in vc! Somebody else has to join you!

How to use this script:

  1. Accept the quest under User Settings -> Gift Inventory
@Faria-Ejaz
Faria-Ejaz / Map.js
Last active May 12, 2024 20:57
react Leaflet Map with Auto-suggest Search #leaflet #react-leaflet #search
/** @format */
import { Map, TileLayer, Marker, Popup } from "react-leaflet";
import React, { useEffect, useState, useRef } from "react";
import { geosearch } from "esri-leaflet-geocoder";
import "leaflet/dist/leaflet.css";
import "esri-leaflet-geocoder/dist/esri-leaflet-geocoder.css";
import L from "leaflet";
function MapView(props) {
@vtta
vtta / acmart.typ
Last active May 12, 2024 20:53
acmart typst template
// made according to typst ieee template and official acm word template
// --- Draft Formatting
// Papers will be submitted electronically in PDF format via the web submission form.
// 1. Submissions may have at most 12 pages of technical content, including all text, figures, tables, etc. Bibliographic references are not included in the 12-page limit.
// 2. Use A4 or US letter paper size, with all text and figures fitting inside a 178 x 229 mm (7 x 9 in) block centered on the page, using two columns separated by 8 mm (0.33) of whitespace.
// 3. Use 10-point font (typeface Times Roman, Linux Libertine, etc.) on 12-point (single-spaced) leading.
// 4. Graphs and figures should be readable when printed in grayscale, without magnification.