Skip to content

Instantly share code, notes, and snippets.

@marzme
marzme / Convert-WingetTextToObjectBackup.ps1
Last active June 30, 2026 19:38
A PowerShell function that converts the text output from winget into PowerShell objects.
Function Convert-WingetTextToObject {
<#
.SYNOPSIS
Converts the text output from winget commands into custom PowerShell objects.
.DESCRIPTION
Converts the text output from winget commands into custom PowerShell objects.
.PARAMETER WingetRawText
@irazasyed
irazasyed / outbound-email-with-cloudflare.md
Last active July 15, 2026 22:17
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

while ! rsync --partial --progress -avz -e ssh "user@server:/path/folder.to.copy" "/to.local.path"; do sleep 5; done
@andrewchilds
andrewchilds / saveGPT.bookmarklet.js
Last active May 13, 2026 09:14
Download ChatGPT conversations as markdown files.
javascript:function parseChatGPTData(data) { const mapping = data.mapping; const conversationTitle = data.title; const createDate = new Date(data.create_time * 1000).toISOString().slice(0, 10); const messagesArray = Object.values(mapping) .filter(node => node.message) .map(node => { const message = node.message; const sender = message.author.role === 'user' ? 'You' : 'Assistant'; const content = message.content.parts.join(''); const createTime = message.create_time; return { sender: sender, content: content, createTime: createTime, }; }); messagesArray.sort((a, b) => a.createTime - b.createTime); return { date: createDate, title: conversationTitle, messages: messagesArray.map(({ sender, content }) => ({ sender, content })), }; } function download(filename, text) { const element = document.createElement('a'); element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text)); element.setAttribute('download', filename); element.style.display = 'none'; document.body.appendChild(element); e
@eugrus
eugrus / Keyb Layout Shortcuts.reg
Last active August 10, 2023 19:39
Workaround for the Windows bug rewriting the user's set up keyboard layout switching shortcuts. This hack rewrites the defaults. This one is set up as following: Ctrl+1 - German; Ctrl+2 - Russian; Ctrl+3 - US-English; Ctrl+4 - Canadian Int for French
Windows Registry Editor Version 5.00
[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys]
[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000100]
"Virtual Key"=hex:33,00,00,00
"Key Modifiers"=hex:02,c0,00,00
"Target IME"=hex:09,04,09,04
[HKEY_USERS\.DEFAULT\Control Panel\Input Method\Hot Keys\00000101]
@eugrus
eugrus / pdfmargins
Last active September 20, 2023 15:44
Add 1cm margins left and right to every page of a PDF using pdflatex directly
for INPUT_PDF_FILE in "$@"; do
if [ "$(file -b --mime-type "$INPUT_PDF_FILE")" == "application/pdf" ]; then
OUTPUT_PDF_FILE="${INPUT_PDF_FILE%.pdf}.margins"
pdflatex -jobname "$OUTPUT_PDF_FILE" "\documentclass{article}\usepackage{pdfpages}\begin{document}\includepdf[pages=-,trim=1cm 0cm 1cm 0cm]{$INPUT_PDF_FILE}\end{document}"
else
echo "Skipping non-PDF file: $INPUT_PDF_FILE"
fi
done
@jfeilbach
jfeilbach / grub.md
Last active May 28, 2026 23:11
Make Linux fast

In /etc/default/grub, modify:

noibrs noibpb nopti nospectre_v2 nospectre_v1 l1tf=off nospec_store_bypass_disable no_stf_barrier mds=off tsx=on tsx_async_abort=off mitigations=off 

Then sudo update-grub

from https:// make-linux-fast-again.com/ This domain does not seem to be maintained any longer.

@bitsurgeon
bitsurgeon / youtube.md
Last active June 5, 2026 09:22
Markdown cheatsheet for YouTube

Embed YouTube Video in Markdown File

  1. Markdown style
[![Watch the video](https://img.youtube.com/vi/nTQUwghvy5Q/default.jpg)](https://youtu.be/nTQUwghvy5Q)
  1. HTML style
<a href="http://www.youtube.com/watch?feature=player_embedded&v=nTQUwghvy5Q" target="_blank">
@ninrod
ninrod / workflowy-to-org-mode.el
Created July 7, 2016 20:30
Convert from Workflowy export format to Org-Mode
(defun workflowy-to-org-mode ()
(interactive)
(let (count)
(while (not (eobp))
(setq count 0)
(while (looking-at " ")
(setq count (1+ count))
(forward-char 1))
(forward-char 1)
(delete-region (point-at-bol) (point))
@luser-dr00g
luser-dr00g / xcr.c
Created August 30, 2014 09:35
xcb+cairo hello world window
//xcr.c
//cc -o xcr $(pkg-config --cflags --libs cairo xcb xcb-icccm) xcr.c -lcairo -lxcb -lxcb-icccm
#include <stdlib.h>
#include <string.h>
#include <cairo.h>
#include <cairo-xcb.h>
#include <xcb/xcb.h>
#include <xcb/xcb_image.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_icccm.h>