Skip to content

Instantly share code, notes, and snippets.

View ntwb's full-sized avatar
🏠
Working from home

Stephen Edgar ntwb

🏠
Working from home
View GitHub Profile
@adnan360
adnan360 / mailtodisk_in_lampp_linux.md
Last active September 1, 2019 02:25
Use of mailtodisk / mailoutput in XAMPP for Linux
@kasparsd
kasparsd / wp-wxr-extract-images.php
Created March 1, 2017 10:59
Extract attachment URLs from WordPress WXR export files
<?php
// Get a list of all WRX export files
$files = glob( 'wrx-export/*.xml' );
// Remove invalid XML attributes and values which prevent SimpleXML from parsing the file
// This shouldn't be necessary, if the exported creates a valid XML file.
$replace = array(
'&uuml;' => '',
'&hellip;' => '',
@johnbillion
johnbillion / install-all-languages.sh
Created February 18, 2017 20:12
Install all available languages on a WordPress site with WP-CLI
wp core language list --field=language | xargs -n 1 wp core language install
@JonTheNiceGuy
JonTheNiceGuy / AAA_iBeacon_README.md
Last active January 8, 2018 20:57
Use your Debian System as an iBeacon for Home Automation

Use your Debian System as an iBeacon for Home Automation

Introduction

I have been playing with using the https://Home-Assistant.io system at home to play with Home Automation.

One thing I've found is that the Raspberry Pi is perfect for quite a few of the monitoring things that I wanted it to do (see also https://github.com/JonTheNiceGuy/home-assistant-configs for more details of what I'm doing there!).

I'm using the http://OwnTracks.org application to talk to an MQTT server, but I could also do with it knowing where I am in the house, so I looked around for some details on iBeacons.

iBeacon is an Apple standard, but it's very easy to configure on Linux systems. I took some pointers from this article and wrote up this script. When I later went to deploy this on another system, I also needed a pointer from [this PDF](https://cdn-learn.adafruit.com/downloads/pdf/pibeacon-ib

@maxrimue
maxrimue / readme.md
Last active March 13, 2021 12:21
Use yarn with Greenkeeper

Use yarn with Greenkeeper

When using yarn, it will create a yarn.lock lockfile which holds data on your used dependencies. This file also includes hard-typed versions, so should you update your dependencies, the yarn.lock file is basically outdated and needs to be regenerated. While yarn does this automatically, Greenkeeper pull requests that update dependencies as of right now do not do this regeneration, which means you would have to do it manually.

This gist shows you a way how to automatise this step using a Travis CI script.

Prerequisites

  • You use Travis CI and have it build Pull Requests (default behaviour)
  • You have a yarn.lock file in your repository for Travis CI to automatically install yarn (yarn will be added to their default images soon)

Getting started

#!/bin/bash
# Update Git and SVN repos checked out in the same directory.
#
# Pass a branch name like 4.6 as the sole argument to checkout that branch. Otherwise, master/trunk is checked out.
set -ex
cd "$(dirname $0)"
git fetch origin --tags
@DanielBakovic
DanielBakovic / conditional_buddypress.php
Created September 7, 2016 08:20
Conditional BuddyPress CSS/JavaScripts
<?php
function conditional_buddypress_styles_scripts() {
// First check that buddypress exists to prevent fatal errors
if ( function_exists( 'is_buddypress' ) ) {
//dequeue scripts and styles
if ( ! is_buddypress() ) {
wp_dequeue_style( 'bp-mentions-css' );
wp_dequeue_style( 'bp-legacy-css' );
wp_dequeue_script( 'bp-confirm' );
@DanielBakovic
DanielBakovic / conditional_bbpress_style.php
Created September 7, 2016 08:18
Conditional loadinf of bbPress CSS/JavaScripts
<?php
function conditional_bbpress_styles_scripts() {
// First check that bbpress exists to prevent fatal errors
if ( function_exists( 'is_bbpress' ) ) {
//dequeue scripts and styles
if ( ! is_bbpress() && ! is_buddypress() ) {
wp_dequeue_style('bbp-default');
wp_dequeue_style( 'bbp_private_replies_style');
wp_dequeue_script('bbpress-editor');
}
@foliovision
foliovision / bbpress-conversion-clean-up.php
Created May 24, 2016 14:50
bbPress 1 to bbPress 2 cleanup tool
<?php
/*
Please read the bbPress 1 conversion article on foliovision.com before using
*/
include('wp-load.php');
global $wpdb;
$aPosts = $wpdb->get_results( "SELECT * FROM $wpdb->posts AS p JOIN $wpdb->postmeta AS m ON p.ID = m.post_id WHERE post_type IN ('forum','topic','reply') AND ( meta_key = '_bbp_old_topic_id' ) LIMIT 10000 " );
@cdils
cdils / bbpress.scss
Last active January 21, 2019 21:21
This is quick, sassified version of the default bbPress stylesheet. I did not sassify the media queries at this point (I intend to re-work those as mobile-first for my project). Also note that I kept the original stylesheet organization. There's repition of some selectors that could be avoidded if the current organization was disregarded. :) As …
/**
* bbPress specific CSS
*
* @package bbPress
* @subpackage Theme
*/
/* =bbPress Style
-------------------------------------------------------------- */