Skip to content

Instantly share code, notes, and snippets.

@gitdagray
gitdagray / util.js
Last active August 21, 2025 13:23
Javascript Utility Functions
// Youtube tutorial here: https://youtu.be/LDgPTw6tePk
// These functions are designed to be exported, but you could create a class instead. See tutorial video.
// #1 proper case
export const properCase = (string) => {
return `${string[0].toUpperCase()}${string.slice(1).toLowerCase()}`;
};
@ahmad-511
ahmad-511 / utils.js
Last active August 21, 2025 13:25
General JS utility functions
// #1 Select first matched element
export function $(selector, elem) {
elem = elem || document;
return elem.querySelector(selector);
}
// #2 Select all matched elements
export function $$(selector, elem) {
elem = elem || document;
return elem.querySelectorAll(selector);
@guwidoe
guwidoe / GetLocalOneDrivePath.bas.vb
Last active November 15, 2025 15:13
VBA Function to get the local path of a OneDrive/SharePoint synchronized Microsoft Office file
'Attribute VB_Name = "OneDrivePathConversion"
'
' Cross-platform VBA Function to get the local path of OneDrive/SharePoint
' synchronized Microsoft Office files (Works on Windows and on macOS) and
' Cross-platform VBA Function to get the OneDrive/SharePoint Url path (link)
' from a local path of a locally synced folder (Works on Windows and on macOS)
'
' Author: Guido Witt-Dörring
' Created: 2022/07/01
' Updated: 2025/06/02
@maciejpedzich
maciejpedzich / TableOfContents.astro
Last active August 25, 2025 06:07
Astro Table Of Contents Component + Sample Usage
---
import type { MarkdownHeading } from 'astro';
type Props = {
headings: MarkdownHeading[];
};
type HeadingWithSubheadings = MarkdownHeading & {
subheadings: MarkdownHeading[];
};
@fensoft
fensoft / fix-grub.sh
Last active November 6, 2025 21:25
install ubuntu 22 64 bits on 32 bits EFI
copy https://github.com/hirotakaster/baytail-bootia32.efi/blob/master/bootia32.efi to /EFI/BOOT
after installing ubuntu:
sudo passwd ubuntu
sudo apt update
sudo apt install openssh-server
ssh to your computer, then:
sudo mount /dev/mmcblk1p2 /mnt
sudo mount --bind /dev /mnt/dev