Skip to content

Instantly share code, notes, and snippets.

View BillyHilly's full-sized avatar

Billy Hill BillyHilly

View GitHub Profile
@tomhicks
tomhicks / plink-plonk.js
Last active March 18, 2024 02:23
Listen to your web pages
@knuch
knuch / functions.php
Created July 24, 2019 08:32
Gutenberg override core block
<?php
// https://developer.wordpress.org/reference/hooks/render_block/
add_filter( 'render_block', 'foo_core_gallery_filter', 10, 3);
function foo_core_gallery_filter( $block_content, $block ) {
// use blockName to only affect the desired block
if( "core/calendar" !== $block['blockName'] ) {
@eviltester
eviltester / linkchecker.js
Last active January 15, 2024 04:48
link checking from snippets
var links = document.querySelectorAll("a");
var linkReport = [];
var linksChecked=0;
links.forEach(function(link){
var reportLine = {url: link.getAttribute('href'), status:0, redirectedTo: "", message : "", element : link};
linkReport.push(reportLine);
console.log("HEAD " + reportLine.url);

Fix for FOUC :

At the top of your HTML:

<!doctype html>
<html>
<head>
    <style>html{visibility: hidden;opacity:0;}</style>
@senorprogrammer
senorprogrammer / drobopi.md
Last active April 7, 2024 00:48
Mount Drobo on Raspberry Pi

On the Drobo

  1. Install the NFS app.

  2. In your Drobo Dashboard, under "Share Settings", make sure the directory you want to share is accessible to "Everyone".

On the Raspberry Pi

  1. Create a mount point: mkdir Common, where "Common" is the name of the directory you want to share (could be "Downloads", "raspi", whatever you want; I used "Common").
@HarvsG
HarvsG / UltimatePiHoleVPN.md
Last active November 28, 2023 21:03
Reminder on how I set up a kickass VPN server with PiHole and encrypted DNS

Initial setup

This is more of a note-to self, but please feel more than free to replicate it.

  1. Follow this PiHole guide:
    • But in the first command replace wget https://git.io/vpn -O openvpn-install.sh with wget https://raw.githubusercontent.com/Angristan/OpenVPN-install/master/openvpn-install.sh -O openvpn-install.sh
    • Stick with the default options unless you know better (or the guide does in the case of tun0 vs eth0)
      • Depending on your privacy concerns and the development status of FTLDNS you may want to opt out of the DNS logging options.
    • Make sure to configure iptables to reload on restart by doing sudo bash -c "iptables-save > /etc/iptables.conf" and then adding iptables-restore < /etc/iptables.conf to /etc/rc.local
  • If doing ho
@punyaruchal
punyaruchal / Apache_Multiple_PHP_Versions_Setup:on_macOS_High_Sierra.md
Last active March 4, 2023 08:21
MacOS 10.13 High Sierra Apache Setup: Multiple PHP Versions

Warning: Due to Homebrew/php tap being deprecated at the end of March 2018, and the moving of all PHP formulas to Homebrew/core, the installation of PHP versions we currently use is going to change. Currently PHP 7.2 is available in the core, but we are waiting on previous versions to be made available and will update this guide as soon as we can. Thanks!

Part 1: macOS 10.13 High Sierra Web Development Environment

Note: This is an updated version of our prior OS X development series. The newly released macOS 10.13 High Sierra and the accompanying updates to Brew require significant changes compared to prior releases, necessitating a thorough revamp in the process. Since 10.12 we now use Homebrew's Apache, rather than the built-in version, but this new appraoch is more flexible and should continue to work on prior OS X versions.

Developing web applications on macOS is a real joy. There are plenty of options for setting up your develop

@S1SYPHOS
S1SYPHOS / svg-url.scss
Created February 17, 2018 23:54
SASS function to create an inline SVG url() source.
/*
* Replacing SVG strings in data-uri style situations
* by Jakob Erikson -- https://github.com/jakob-e
*
* http://codepen.io/jakob-e/pen/doMoML
*/
// Function to replace characters in a string
@function str-replace($string, $search, $replace: '') {
$index: str-index($string, $search);
@rickhernandezio
rickhernandezio / permissions.sh
Last active May 15, 2024 00:46
Permissions for Mautic
cd /var/www/mautic
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;
chmod -R g+w app/cache/
chmod -R g+w app/logs/
chmod -R g+w app/config/
chmod -R g+w media/files/
chmod -R g+w media/images/
chmod -R g+w translations/
chown -R $USER:www-data .