Skip to content

Instantly share code, notes, and snippets.

View danjdewhurst's full-sized avatar

Dan danjdewhurst

  • http://reckless.agency/
  • England, United Kingdom
View GitHub Profile
@danjdewhurst
danjdewhurst / cf-ips.sh
Created June 19, 2024 16:22
Bash script to update a htaccess file with rules to block non-CloudFlare requests via IP
#!/bin/bash
# URL to fetch Cloudflare IP ranges
ipv4_url="https://www.cloudflare.com/ips-v4"
ipv6_url="https://www.cloudflare.com/ips-v6"
# Temporary files to store IP ranges
tmp_ipv4="/tmp/cloudflare_ipv4.tmp"
tmp_ipv6="/tmp/cloudflare_ipv6.tmp"
@danjdewhurst
danjdewhurst / httpd.conf
Created May 22, 2019 13:22
Arch httpd.conf to work with PHP 7.x
#
# This is the main Apache HTTP server configuration file. It contains the
# configuration directives that give the server its instructions.
# See <URL:http://httpd.apache.org/docs/2.4/> for detailed information.
# In particular, see
# <URL:http://httpd.apache.org/docs/2.4/mod/directives.html>
# for a discussion of each configuration directive.
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
@danjdewhurst
danjdewhurst / _wordpress.scss
Last active October 18, 2017 11:01
Core WordPress Styles CSS Converted Into SCSS
.alignnone {
margin: 0 20px 20px 0;
}
.aligncenter,
div.aligncenter {
display: block;
margin: 0 auto 0 auto;
}
@danjdewhurst
danjdewhurst / swiper_base.js
Created March 23, 2017 11:20
Swiper.js Base
/**
* Initialise Swipers.
*/
var swiper_no = 0;
var swipers = [];
$('.swiper-container').each(function() {
swiper_no++;
var slides = 1;
if($(this).data('slides')) {
var $status = $('.nav.status.color-status span');
$status.each( function() {
var $element = $( this );
if ( $element.prop( 'title' ) == 'In Progress' || $element.prop( 'title' ) == 'Paused' ) {
$element.parent().parent().css( 'background-color', '#ffd699' );