Skip to content

Instantly share code, notes, and snippets.

View jonathan-dejong's full-sized avatar

Jonathan de Jong jonathan-dejong

View GitHub Profile
@jonathan-dejong
jonathan-dejong / Atom settings
Last active December 19, 2017 13:21
Atom sync!
@jonathan-dejong
jonathan-dejong / apache host
Created May 31, 2017 21:45
host for owncloud
<VirtualHost *:80>
ServerName YOUR-OWNCLOUD-URL
RewriteEngine on
RewriteCond %{SERVER_NAME} =YOUR-OWNCLOUD-URL
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
</VirtualHost>
<VirtualHost *:443>
@jonathan-dejong
jonathan-dejong / csv-split-by-lines.sh
Last active September 18, 2019 18:35
Split CSV files by megabyte and retain head row (row 1)
#!/bin/bash
if [ ! -d "./backup" ]; then
mkdir backup
fi
lines=2000
for i in *.csv; do
split -b ${1:-$lines} $i ${i%.csv}-
for j in ${i%.csv}-a*; do
if [[ "$j" != *-aa ]]
@jonathan-dejong
jonathan-dejong / drop-it-like-its-hot.php
Created March 2, 2020 08:14
Drop cache on ACF options page update
// This is in the context of a namespaced class.
public function acf_save_post( $post_id ) {
// Retrieves all acf option page slugs.
$option_slugs = array_unique(
array_map(
function( $options_page ) {
return $options_page['post_id'];
},
acf_get_option_pages()
)
@jonathan-dejong
jonathan-dejong / ufw_plex.md
Created May 24, 2020 19:46 — forked from nmaggioni/ufw_plex.md
Plex Media Server UFW rule

/etc/ufw/applications.d/plexmediaserver

[plexmediaserver]
title=Plex Media Server (Standard)
description=The Plex Media Server
ports=32400/tcp|3005/tcp|5353/udp|8324/tcp|32410:32414/udp

[plexmediaserver-dlna]
title=Plex Media Server (DLNA)
description=The Plex Media Server (additional DLNA capability only)