Skip to content

Instantly share code, notes, and snippets.

@brasofilo
brasofilo / inject.html
Last active March 30, 2023 02:01
Orbital :: WordPress Login Form :: adapted by brasofilo, original code by https://codepen.io/guerreiro/pen/rNZajZ
<div id="logoBox">
<svg viewBox="0 0 160 160" width="160" height="160">
<circle cx="80" cy="80" r="50" />
<g transform=" matrix(0.866, -0.5, 0.25, 0.433, 80, 80)">
<path d="M 0,70 A 65,70 0 0,0 65,0 5,5 0 0,1 75,0 75,70 0 0,1 0,70Z" fill="#FFF">
<animateTransform attributeName="transform" type="rotate" from="360 0 0" to="0 0 0" dur="1s" repeatCount="indefinite" />
</path>
</g>
<path d="M 50,0 A 50,50 0 0,0 -50,0Z" transform="matrix(0.866, -0.5, 0.5, 0.866, 80, 80)" />
</svg>
@brasofilo
brasofilo / services_nextcloud_stack-compose.yml
Created January 22, 2021 03:28 — forked from robin-moser/services_nextcloud_stack-compose.yml
VPS Nextcloud Installation - Single Node Swarm, Portainer, Traefik LB
version: '3.7'
services:
mysql:
image: mariadb:10.3.5
networks:
- default
environment:
MYSQL_ROOT_PASSWORD: $DB_ROOT_PASSWORD
MYSQL_DATABASE: $DB_NAME
@brasofilo
brasofilo / download.php
Created June 3, 2012 12:55
Force File Download with PHP
<?php
/*
* Foce File Download
* Usage: http://example.com/download.php?file=./uploads/image.jpg
*
* There are a couple of *ninja* exit() as security guarantee, adapt as necessary
*
*/
// grab the requested file's name
<?php
/* Original code from:
* http://bradt.ca/archives/image-crop-position-in-wordpress/
*
* Modified to WordPress Answers:
* http://wordpress.stackexchange.com/q/51920/12615
*
* Check the function bt_image_make_intermediate_size
* That's where the Thumbnails renaming occurs and all added images must be inserted
*
<?php
/*
Plugin Name: Post Meta Revisions
Description: Revisions for the 'foo' post meta field
Version: 1.0
Author: John Blackbourn
Plugin URI: http://lud.icro.us/post-meta-revisions-wordpress
*/
@brasofilo
brasofilo / convert-xml.php
Last active February 19, 2021 16:11
Convert Codex XML to Apple Dictionary XML
<?php
header('Content-type: text/xml');
header('Pragma: public');
header('Cache-control: private');
header('Expires: -1');
echo "<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n";
echo '<d:dictionary xmlns="http://www.w3.org/1999/xhtml" xmlns:d="http://www.apple.com/DTDs/DictionaryService-1.0.rng">' . "\r\n";
@brasofilo
brasofilo / A Collection of User Scripts.md
Last active January 28, 2021 05:13
CommentsFormattingShortcuts.js (scripts here are linked from stackapps.com)
@brasofilo
brasofilo / nginx.conf
Created May 10, 2020 13:05 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@brasofilo
brasofilo / plugin.php
Last active April 6, 2020 01:13
Original code for Multisite Categories. At WordPress Answers http://wordpress.stackexchange.com/a/50936/12615
<?php
/**
* Plugin Name: Multisite Site Category
* Plugin URI: https://gist.github.com/brasofilo/6715423
* Description: Add a custom meta option when registering new sites in WordPress Multisite. Two columns will be added to the Sites listing screen: ID and Category. Based on http://wordpress.stackexchange.com/a/50936/12615
* Network: true
* Author: Rodolfo Buaiz
* Author URI: http://brasofilo.com/
* Version: 1.1
@brasofilo
brasofilo / authorized-acf-access.php
Created December 8, 2012 18:53
Hide ACF Menu from Clients
/**
* A method to really block access to ACF menu
* http://www.advancedcustomfields.com/docs/tutorials/hide-acf-menu-from-clients/
*/
/**
* Remove ACF menu item from the admin menu
*/
add_action( 'admin_menu', 'acf_remove_menu_page', 15 );