Skip to content

Instantly share code, notes, and snippets.

View danielm's full-sized avatar
🎯
Focusing

Daniel Morales danielm

🎯
Focusing
View GitHub Profile
DOTNET_FILE="dotnet-sdk-8.0.404-linux-x64.tar.gz"
# <<< .config/.profile
export DOTNET_ROOT="$HOME/.dotnet"
export DOTNET_CLI_TELEMETRY_OPTOUT=1
# >>>
# Dependencies
sudo pacman -Sy glibc gcc krb5 icu openssl libc++ zlib
@danielm
danielm / app.controller-1.ts
Created October 8, 2024 00:09 — forked from andreacioni/app.controller-1.ts
NestJS Authentication: Single Sign On with SAML 2.0
@Get('api/auth/sso/saml/login')
@UseGuards(SamlAuthGuard)
async samlLogin() {
//this route is handled by passport-saml
return;
}
@danielm
danielm / wake-issue.md
Created September 23, 2024 09:00 — forked from george-hawkins/wake-issue.md
After installing Ubuntu 20.04 my machine frequently wakes from sleep for no obvious reason. This gist describes my attempts to resolve this.

Diagnosing spurious wakes

This gist documents my attempts to get to the bottom of spurious wakes after installing Ubuntu 20.04 LTS on my system.

Initially, I thought it might be another system on my network sending Wake-on-LAN (WoL) packets. Then I thought it might be a known XHCI spurious wake kernel issue. And lastly, I finally resolved things by actively disabling the ability of USB devices, e.g. the mouse, to wake the system.

Update: I later came up with a better way of disabling wake-on-mouse that's covered here.

Note: as one of these steps, I upgraded the system BIOS - while this didn't resolve this particular issue, it did resolve an annoying issue with the graphic state not being properly restored for certain applications after wake-up.

@danielm
danielm / bracket.html
Created June 24, 2024 14:11 — forked from Loupeznik/bracket.html
Playoffs bracket Tailwind component
<div class="m-2 p-4">
<div class="mb-4 grid grid-flow-col grid-cols-3 items-center border-0 border-b-2 border-gray-200 text-center text-base md:text-lg font-bold uppercase">
<div>Quarterfinals</div>
<div>Semifinals</div>
<div>Finals</div>
</div>
<div class="grid grid-flow-col grid-cols-3 items-center">
<div class="grid grid-flow-row grid-rows-3">
<div class="mb-4 rounded-md bg-gray-200 px-4 py-2 text-gray-900 space-y-2 text-xs md:text-base">
<div class="grid grid-flow-col grid-cols-2">
@danielm
danielm / count-line-length.sh
Created June 15, 2024 17:06
Max line length ina single file
awk '{print length}' yourfile.csv | sort -nr | head -1
@danielm
danielm / array-differences.php
Last active June 14, 2024 23:23
Find differences between two Arrays of strings in PHP
<?php
function findDifferences(array $array1, array $array2)
{
// Elements present in array1 but not in array2
$missingInArray2 = array_diff($array1, $array2);
// Elements present in array2 but not in array1
$addedInArray2 = array_diff($array2, $array1);
#!/bin/bash
#
# This script rename to a more userfriendy file name, so we can easly view/sort it etc.
# Specially in multi-part files, Given the Nameing convention:
# https://community.gopro.com/s/article/GoPro-Camera-File-Naming-Convention?language=en_US
#
# Eample:
# - GH010051.MP4 ==> GH0051-01.mp4
# - GH020051.MP4 ==> GH0051-02.mp4
----
[---->+<]
>++.
--
[----->+<]
>-.
++++
[->+++<]
>+.
+++++.
@danielm
danielm / clean-up-arch-linux.md
Created March 13, 2023 23:08 — forked from rumansaleem/clean-up-arch-linux.md
Instructions to clean up Arch Linux (Manjaro)

Contents

  • Clean pkg cache
  • Remove unused packages (orphans)
  • Clean cache in /home
  • remove old config files
  • Find and Remove
    • duplicates
    • empty files
    • empty directories
  • broken symlinks
@danielm
danielm / Arch Linux - TLDR Install.md
Last active June 24, 2022 22:21
Arch Linux - TLDR Install