Skip to content

Instantly share code, notes, and snippets.

View ilario-pierbattista's full-sized avatar
🏠
Working from home

Ilario Pierbattista ilario-pierbattista

🏠
Working from home
View GitHub Profile
@the-spyke
the-spyke / pipewire.md
Last active April 16, 2025 18:44
Enable PipeWire on Ubuntu 22.04

Enable PipeWire on Ubuntu 22.04

This guide is only for original Ubuntu out-of-the-box packages. If you have added a custom PPA like pipewire-debian, you might get into conflicts.

Ubuntu 22.04 has PipeWire partially installed and enabled as it's used by browsers (WebRTC) for recoding the screeen under Wayland. We can enable remaining parts and use PipeWire for audio and Bluetooth instead of PulseAudio.

Starting from WirePlumber version 0.4.8 automatic Bluetooth profile switching (e.g. switching from A2DP to HSP/HFP when an application needs microphone access) is supported. Jammy (22.04) repos provide exactly version 0.4.8. So, we're good.

Based on Debian Wiki, but simplified for Ubuntu 22.04.

@vladak
vladak / varmilo keyboard.md
Last active April 28, 2025 18:38
Varmilo keyboard details
@roaldnefs
roaldnefs / mac-docker-gui.txt
Created December 22, 2019 10:27
Running GUI application in Docker on MacOS
# Install XQuartz
brew cask install xquartz
# Restart MacOS
# Open XQuartz
open -a XQuartz
# Ensure the "Allow connections from network clients" option in Preferences >> Security is turned on
@ruizb
ruizb / advanced-example.md
Last active September 26, 2023 20:21
Reader monad example using fp-ts

The following section is not part of monet.js documentation, but I think it's worth showing how we can compose readers using fp-ts.

Reader composition

Let's say we have the following piece of code:

interface Dependencies {
  logger: { log: (message: string) => void }
 env: 'development' | 'production'
@mohanpedala
mohanpedala / bash_strict_mode.md
Last active April 29, 2025 16:11
set -e, -u, -o, -x pipefail explanation
@masbog
masbog / VMware-Player-12.5.2-4638234_Linux-4.9_patch.sh
Created March 10, 2017 07:23
fix too few arguments to function "get_user_pages_remote" on Fedora 25 kernel 4.9.13-200
#!/bin/bash
cp -n /usr/lib/vmware/modules/source/vmmon.tar /usr/lib/vmware/modules/source/vmmon.tar_bak
cp /usr/lib/vmware/modules/source/vmmon.tar .
tar xf vmmon.tar
patch -p0 << "EOF"
--- vmmon-only/linux/hostif.c
+++ vmmon-only/linux/hostif.c
@@ -1162,7 +1162,9 @@
int retval;
@cryzed
cryzed / fix-infinality.md
Last active March 20, 2025 13:16
A set of instructions on how to fix the harfbuzz + Infinality issue and restoring good-looking, Infinality-like font rendering.

Disclaimer: Please follow this guide being aware of the fact that I'm not an expert regarding the things outlined below, however I made my best attempt. A few people in IRC confirmed it worked for them and the results looked acceptable.

Attention: After following all the steps run gdk-pixbuf-query-loaders --update-cache as root, this prevents various gdk-related bugs that have been reported in the last few hours. Symptoms are varied, and for Cinnamon the DE fails to start entirely while for XFCE the icon theme seemingly can't be changed anymore etc.

Check the gist's comments for any further tips and instructions, especially if you are running into problems!

Screenshots

Results after following the guide as of 11.01.2017 13:08:

@petrkotek
petrkotek / recursive-generator-php70.php
Created September 19, 2016 08:38
Demonstrates how to implement recursive generators in PHP 7.0+
<?php
function walkTree($tree, $depth = 0) {
foreach ($tree as $key => $value) {
yield ['depth' => $depth, 'name' => $key];
if (is_array($value)) {
yield from walkTree($value, $depth + 1);
}
}
}
$tree = [
@carlessanagustin
carlessanagustin / Nginx_Cheat_Sheet.md
Last active April 21, 2025 02:32
Nginx Cheat Sheet
@tjamps
tjamps / README.md
Last active March 19, 2025 00:30
Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

Basic RESTful API with Symfony 2 + FOSRestBundle (JSON format only) + FOSUserBundle + FOSOauthServerBundle

The API we are creating in this gist will follow these rules :

  • The API only returns JSON responses
  • All API routes require authentication
  • Authentication is handled via OAuth2 with password Grant Type only (no need for Authorization pages and such).
  • API versioning is managed via a subdomain (e.g. v1.api.example.com)

The API will be written in PHP with the Symfony 2 framework. The following SF2 bundles are used :