Skip to content

Instantly share code, notes, and snippets.

View adamplabarge's full-sized avatar

Adam LaBarge adamplabarge

View GitHub Profile
@adamplabarge
adamplabarge / docker-compose.yml
Created August 23, 2022 01:34
WordPress, phpMyAdmin, MariaDb, NocoDb
version: '3'
services:
db:
# We use a mariadb image which supports both amd64 & arm64 architecture
image: mariadb
# If you really want to use MySQL, uncomment the following line
#image: mysql:8.0.27
command: '--default-authentication-plugin=mysql_native_password'
volumes:
- db_data:/var/lib/mysql
@adamplabarge
adamplabarge / bluecharm.js
Last active May 28, 2022 04:47
[DOES NOT CURRENTLY SEEM TO WORK] A script to listen to BC08 Water-Resistant iBeacon BLE 4.0/5.0 MultiBeacon
// NOTE - This code does not seem to show motion events from the beacon.
/**
...dependencies & engine
"dependencies": {
"@abandonware/bluetooth-hci-socket": "^0.5.3-8",
"@abandonware/noble": "^1.9.2-15",
"node-beacon-scanner": "^0.2.2"
},
"engines": {
"node": "12.22.12",
@adamplabarge
adamplabarge / javasctipt_extra_practice.js
Last active June 13, 2021 21:53
NuCamp ES6 - extra practice - JavaScript Array and Object
// Here is some extra practice work for javascript arrays and objects.
const data = [
{
id: 2,
name: 'Michael',
address: {
state: 'CA',
zip: 94501
}
},
@adamplabarge
adamplabarge / plugin.php
Created January 8, 2018 05:44
Portland WP Meetup - Hooks and Filters - Jan 08 2018 - Hooks and Filters in a plugins and Class
<?php
/**
* Plugin Name: TheAudioBeatnik Category Slideshow
* Description: A category page slideshow using Slick.js and WP Plugin Advanced Custom Fields
* Author: Adam LaBarge
* Version: 1.0
* Author URI: https://www.linkedin.com/in/adamlabarge
*/
class tab_CategorySlideShow {
@adamplabarge
adamplabarge / plugin.php
Last active January 8, 2018 21:24
Portland WP Meetup - Hooks and Filters - Jan 08 2018 - Sample Hooks Plugin Code
<?php
/*
Plugin Name: Sample Plugin
Plugin URI:
Description: Sample code for the Portland WordPress MeetUp Hooks and Filters Talk
Version: 1.0.0
Author: adamplabarge
Author URI: https://github.com/adamplabarge
Text Domain: sample-plugin
License: GPLv2
@adamplabarge
adamplabarge / rockPaperScissors.py
Created November 29, 2017 17:42
Python Class - Rock Paper Scissors
"""
Some python from a free python class offered by The Tech Academy Portland
https://www.meetup.com/techacademy/
"""
import math
from random import randint
randMin = 0
randMax = 2
@adamplabarge
adamplabarge / .babelrc
Last active February 5, 2017 17:28
Babelify Browserify and SASS Gulp
{
"presets": ["es2015"]
}
<?php
add_action('genesis_before', function() {
global $wpdb;
$post_type = 'product';
$query = "
SELECT DISTINCT($wpdb->postmeta.meta_key)
FROM $wpdb->posts
LEFT JOIN $wpdb->postmeta
<?php
$highlights = new WP_Query($args);
$sort = function(&$posts) {
$props = array('year', 'authors');
usort($posts, function($a, $b) use ($props) {
if ($a->$props[0] == $b->$props[0])
function htmlEncode(str) {
return str.replace(/&/g, '&amp;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&#39;')
.replace(/</g, '&lt;')
.replace(/>/g, '&gt;');
}