Skip to content

Instantly share code, notes, and snippets.

@mkropat
mkropat / knownpaths.py
Last active November 5, 2024 15:09
Python wrapper around the SHGetKnownFolderPath Windows Shell function
import ctypes, sys
from ctypes import windll, wintypes
from uuid import UUID
class GUID(ctypes.Structure): # [1]
_fields_ = [
("Data1", wintypes.DWORD),
("Data2", wintypes.WORD),
("Data3", wintypes.WORD),
("Data4", wintypes.BYTE * 8)
@Iman
Iman / clean.sh
Last active November 13, 2024 21:44
Free up disk space on Ubuntu - clean log, cache, archive packages/apt archives, orphaned packages, old kernel and remove the trash
#!/bin/sh
#Check the Drive Space Used by Cached Files
du -sh /var/cache/apt/archives
#Clean all the log file
#for logs in `find /var/log -type f`; do > $logs; done
logs=`find /var/log -type f`
for i in $logs
@lukechilds
lukechilds / get_latest_release.sh
Created August 9, 2016 19:43
Shell - Get latest release from GitHub
get_latest_release() {
curl --silent "https://api.github.com/repos/$1/releases/latest" | # Get latest release from GitHub api
grep '"tag_name":' | # Get tag line
sed -E 's/.*"([^"]+)".*/\1/' # Pluck JSON value
}
# Usage
# $ get_latest_release "creationix/nvm"
# v0.31.4
@matthewzring
matthewzring / markdown-text-101.md
Last active November 18, 2024 08:27
A guide to Markdown on Discord.

Markdown Text 101

Want to inject some flavor into your everyday text chat? You're in luck! Discord uses Markdown, a simple plain text formatting system that'll help you make your sentences stand out. Here's how to do it! Just add a few characters before & after your desired text to change your text! I'll show you some examples...

What this guide covers:

@angorb
angorb / Bluetooth-Company-Identifiers.csv
Last active November 11, 2024 18:46
[Bluetooth Company Identifiers] Company identifiers are unique numbers assigned by the Bluetooth SIG to member companies requesting one.
0x0000 Ericsson Technology Licensing
0x0001 Nokia Mobile Phones
0x0002 Intel Corp.
0x0003 IBM Corp.
0x0004 Toshiba Corp.
0x0005 3Com
0x0006 Microsoft
0x0007 Lucent
0x0008 Motorola
0x0009 Infineon Technologies AG
@typpo
typpo / BCP47-locales.md
Last active November 11, 2024 13:35
BCP 47 language tags
Language Tag Language Region Description
ar-SA Arabic Saudi Arabia Arabic (Saudi Arabia)
bn-BD Bangla Bangladesh Bangla (Bangladesh)
bn-IN Bangla India Bangla (India)
cs-CZ Czech Czech Republic Czech (Czech Republic)
da-DK Danish Denmark Danish (Denmark)
de-AT German Austria Austrian German
de-CH German Switzerland "Swiss" German
de-DE German Germany