Skip to content

Instantly share code, notes, and snippets.

View devsdmf's full-sized avatar

Lucas Mendes devsdmf

View GitHub Profile
@bitsandbooks
bitsandbooks / README.md
Last active March 26, 2024 06:29
Kickstart Files

Kickstart Files

These files are here to install a minimal environment (i.e., no desktop) for Fedora Linux 38 and Rocky Linux 9. They're designed to partition a single disk device, creating a UEFI partition, a /boot partition, and logical volumes for an 8 GB swap partition, and the majority of the space for a single / volume.

Usage

The files are designed so you need only change a few minor things to make it work for you:

  • Set a hostname in the network options
  • Specify the storage device for the ignoredisk and bootloader options (usually something like sda, vda, or nvme0n1)
@mosquito
mosquito / README.md
Last active June 17, 2024 20:26
Add doker-compose as a systemd unit

Docker compose as a systemd unit

Create file /etc/systemd/system/docker-compose@.service. SystemD calling binaries using an absolute path. In my case is prefixed by /usr/local/bin, you should use paths specific for your environment.

[Unit]
Description=%i service with docker compose
PartOf=docker.service
After=docker.service
@jan-j
jan-j / array_flatmap.php
Last active July 17, 2019 21:10
PHP array flatmap - array_flatmap function
/**
* Applies the callback to the elements of the given arrays, then merge all results to one array
*
* @param callable $callback Callback function to run for each element in each array.
* @param array $array1 An array to run through the callback function.
* @param array $array,... Variable list of array arguments to run through the callback function.
* @return array Returns an array containing all the elements of array1 after
* applying the callback function to each one, casting them to arrays and merging together.
*/
function array_flatmap()
@anantn
anantn / firebase_detect_data.js
Created December 18, 2012 00:54
Firebase: Detecting if data exists. This snippet detects if a user ID is already taken
function go() {
var userId = prompt('Username?', 'Guest');
checkIfUserExists(userId);
}
var USERS_LOCATION = 'https://SampleChat.firebaseIO-demo.com/users';
function userExistsCallback(userId, exists) {
if (exists) {
alert('user ' + userId + ' exists!');