Skip to content

Instantly share code, notes, and snippets.

View mbootsman's full-sized avatar

Marcel Bootsman mbootsman

View GitHub Profile
@mbootsman
mbootsman / unsplash-random.sh
Last active February 3, 2024 05:51
[Ubuntu] Download random unsplash photo and set as background with logo overlay
#/bin/bash
# get image
# adjust 3840x2160 to your screen resolution
wget -O /home/xxxxx/Pictures/wallpaper.jpg https://source.unsplash.com/random/3840x2160/?wallpaper
# add logo
convert /home/xxxxx/Pictures/wallpaper.jpg -page +100+50 /home/xxxxx/Pictures/logo.png -flatten /home/xxxxxx/Pictures/wallpaper-logo.jpg
# set wallpaper
@mbootsman
mbootsman / docker-compose.yml
Created November 24, 2022 09:28
docker-compose file
# based on https://hub.docker.com/r/sparanoid/php-fpm
version: '3'
services:
nginx:
image: nginx:alpine
restart: always
ports:
- 8080:80
# Enable 443 on production
@mbootsman
mbootsman / filetest.php
Created November 24, 2022 09:27
write/read from file test php
<?php
echo file_put_contents('file.txt', 'bar');
echo file_get_contents('file.txt'); // bar
echo "<br />";
file_put_contents('file.txt', 'foo');
echo file_get_contents('file.txt'); // foo
@mbootsman
mbootsman / custom-cpt-permalink-rewrite.php
Last active February 27, 2020 12:43
Custom post type permalink structure with hyphen instead of slash
<?php
/* Facetwp preselect */
add_filter( 'facetwp_preload_url_vars', 'nstrm_filter_facets' );
function nstrm_filter_facets( $url_vars ) {
// get post uri
$uri = FWP()->helper->get_uri();
// get post id
$post_id = nostromo_get_post_id_by_post_name( $uri );
@mbootsman
mbootsman / full-width-review-table-gravityforms.css
Created December 21, 2018 09:12
Full width review table for left aligned labels in Gravity Forms
body .gform_wrapper ul.gform_fields:not(.top_label):last-child > li.gfield_html_formatted:last-child {
margin-left: 0!important;
width:100%;
}