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 July 26, 2024 01:10
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);
@lostfictions
lostfictions / svg-to-css-clip-path-polygon.js
Created January 2, 2018 02:01
convert an svg to a css clip-path polygon
// why do this? clip-path accepts a `url` reference to an svg element, right?
// the difference is that anything defined as a `basic-shape` can be animated:
// https://developer.mozilla.org/en-US/docs/Web/CSS/clip-path
const input = `121.151,20.761 170.165,55.885 200.872,3.816 231.145,55.884 280.592,20.762 286.854,80.687 346.526,68.666
327.657,126.005 387.276,139.247 346.502,184 395.796,220.302 340.127,244.647 370.611,297.814 309.636,297.457 316.076,358.381
260.303,333.3 241.622,391.529 200.655,345.979 160.121,391.53 141.008,333.302 85.666,358.381 91.673,297.456 31.131,297.813
61.183,244.647 5.947,220.302 54.81,184 14.466,139.248 73.652,126.004 55.216,68.667 114.457,80.688 `
const viewBoxScale = 4