Skip to content

Instantly share code, notes, and snippets.

Avatar

Max SpiZeak

View GitHub Profile
View arduino.ino
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 32 // OLED display height, in pixels
// Declaration for an SSD1306 display connected to I2C (SDA, SCL pins)
#define OLED_RESET 4 // Reset pin # (or -1 if sharing Arduino reset pin)
@SpiZeak
SpiZeak / minecraft
Created Jun 23, 2020
A script for controlling a minecraft server
View minecraft
#!/bin/bash
# Author: Max Trewhitt <max@trewhitt.se>
# Template: https://natelandau.com/boilerplate-shell-script-template/
# Description: A script for controlling a minecraft server
# Config
FILENAME=Paper-latest.jar
SERVER_PATH=/home/mc-server
SERVER_DOWNLOAD_URL=https://yivesmirror.com/files/paper/$FILENAME
@SpiZeak
SpiZeak / deploy.sh
Created May 7, 2020
A bash deploy script for safe Wordpress deployments
View deploy.sh
#
# Author: Max Trewhitt - Osolo
# Description: A safe deployment routine script
#
ROOT_FOLDER=example.com
THEME=example_theme
# Stop script on error signal
set -e
@SpiZeak
SpiZeak / search.php
Last active Feb 24, 2021
Search filter for wordpress
View search.php
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@SpiZeak
SpiZeak / .gitignore
Created Apr 23, 2020
.gitignore for WordPress
View .gitignore
# -----------------------------------------------------------------
# .gitignore for WordPress
#
# Author: Max Trewhitt <max@trewhitt.se>
# Version 2020-04-23
#
# By default all files are ignored in the root directory. You'll need to whitelist
# any files you want to include in the repo.
#
# To ignore uncommitted changes in a file that is already tracked, use
@SpiZeak
SpiZeak / svn2git.sh
Last active May 14, 2020 — forked from mlocati/svn2git.sh
Convert SVN repository to GIT
View svn2git.sh
#!/bin/bash
# This script was written for Ubuntu 14.04 and 16.04
# Other operating systems may need a few changes
WORK_DIR=~/svn2git
AUTHORS_FILE=$WORK_DIR/authors.txt
GITDIR_DIRTY=$WORK_DIR/dirty
GITDIR_FINAL=$WORK_DIR/final