Skip to content

Instantly share code, notes, and snippets.

View Axlfc's full-sized avatar
🛸
Working from outer space

Axel Axlfc

🛸
Working from outer space
View GitHub Profile
function Check-DefaultBrowser {
$currentBrowserProgId = (Get-ItemProperty 'HKCU:\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice').ProgId
return -not ($currentBrowserProgId -like "FirefoxURL-*")
}
function Check-DefaultPDFApplication {
$User = New-Object System.Security.Principal.NTAccount($env:UserName)
$sid = $User.Translate([System.Security.Principal.SecurityIdentifier]).value
$key = "HKU:\${sid}\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\FileExts\.pdf\UserChoice"
@Axlfc
Axlfc / gist:168b24c3928ba8521772d8ed510a5620
Created December 15, 2023 17:14
Github Markdown Annotations
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
> [!TIP]
> Optional information to help a user be more successful.
> [!IMPORTANT]
> Crucial information necessary for users to succeed.
> [!WARNING]
@Axlfc
Axlfc / bt_echodot_functions.sh
Last active March 26, 2023 13:22
Bluetooth bash function
# Description: Control Bluetooth via console commands using only one function.
# Argument 1: 'on'; 'off'; 'show'; 'connect'; 'disconnect'; 'scan'; 'pair'
# Argument 2 (connect, disconnect, pair): A Bluetooth device name
bluetooth() {
if [ "$1" = "on" ]; then
sudo rfkill unblock bluetooth
echo "Bluetooth Enabled"
elif [ "$1" = "off" ]; then
sudo rfkill block bluetooth
@Axlfc
Axlfc / manual_install_carbon.sh
Created August 5, 2022 02:23
How to Set Up Carbon Programming Language Manually on Ubuntu 22.04
sudo apt install -y apt-transport-https curl gnupg
curl -fsSL https://bazel.build/bazel-release.pub.gpg | gpg --dearmor > bazel.gpg
sudo mv bazel.gpg /etc/apt/trusted.gpg.d/
echo "deb [arch=amd64] https://storage.googleapis.com/bazel-apt stable jdk1.8" | sudo tee /etc/apt/sources.list.d/bazel.list
sudo apt update -y && sudo apt install -y bazel clang lldb lld openjdk-8-jdk llvm build-essential libc++-dev
echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/llvm/lib"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export CC=$(which clang)' >> ~/.profile
git clone https://github.com/carbon-language/carbon-lang