Skip to content

Instantly share code, notes, and snippets.

View luckyshot's full-sized avatar
🌍
xaviesteve.com

Xavi Esteve luckyshot

🌍
xaviesteve.com
View GitHub Profile
@luckyshot
luckyshot / README.md
Last active October 3, 2024 07:02 — forked from pgillet/README.md
Switch audio output devices on Linux

Audio Output Switcher

This script will cycle to the next available audio output device. It can be tied to a hotkey to easily be triggered. This is handy, for example, for swapping between HDMI audio and headphones.

Install

  1. Download the audio-device-switch.sh script and place it in /usr/local/bin.
  2. Make the script executable: sudo chmod 755 /usr/local/bin/audio-device-switch.sh.
  3. Open the Keyboard Shortcuts settings page, add a new shortcut, tell it to execute audio-device-switch.sh, and set up your shortcut!
  4. Install the notify-send library if you want to see a popup notification when the audio device switches: sudo apt install libnotify-bin.

Customizations

@luckyshot
luckyshot / CleanUpGmail.gs
Last active May 18, 2024 07:17 — forked from alimbada/CleanUpGmail.gs
Google Apps Script for cleaning up Gmail
/**
* Scripts: https://script.google.com/u/0/home/my
* Triggers: https://script.google.com/u/0/home/triggers
*/
function cleanUpGmail() {
var queries = [
'from:([email protected]) in:inbox subject:(from your Steam wishlist on sale) older_than:7d',
'from:([email protected]) in:inbox subject:(is live) older_than:1d',
'from:ebay.com subject:("is live!" OR "has been relisted") older_than:7d',
// Security alerts
@luckyshot
luckyshot / lemon_mysql.php
Last active October 10, 2019 18:29 — forked from AngeloR/lemon_mysql.php
A tiny function to interact with a MySQL database, can be used as a standalone PHP function or inside Limonade-php framework. Returns data in a multi-dimensional associative array. When working with Limonade-php a full-fledged MySQL wrapper seems like overkill. This method instead accepts any mysql statement and if it works returns either the re…
<?php
/**
* A quick little function to interact with a MySQL database.
* Updated by Xavi Esteve to use mysqli, original by AngeloR (https://gist.github.com/AngeloR/919695)
*
* When working with Limonade-php a full-fledged MySQL wrapper seems like
* overkill. This method instead accepts any mysql statement and if it works
* returns either the result or the number of rows affected. If neither worked,
* then it returns false
*