Skip to content

Instantly share code, notes, and snippets.

View halfnibble's full-sized avatar

Josh Wedekind halfnibble

View GitHub Profile
halfnibble /
Created April 23, 2023 21:38
API Readme Table
Method Path Purpose
GET / Home page
GET /places Places index page
POST /places Create new place
GET /places/new Form page for creating a new place
GET /places/:id Details about a particular place
PUT /places/:id Update a particular place
GET /places/:id/edit Form page for editing an existing place
DELETE /places/:id Delete a particular place
halfnibble / login_register.js
Created October 24, 2021 05:55
Toggle Login and Register forms on the Moore Wright Group Woocommerce page.
View login_register.js
* Add this JavaScript early in the DOM so it will execute when the page loads.
* You can use something like the "Simple Custom CSS and JS" plugin:
* If you want to test it, execute the code inside the "DOMContentLoaded"
* function in the developer console on the login|register page.
document.addEventListener("DOMContentLoaded", function (event) {
halfnibble /
Created January 18, 2021 01:37
Minecraft Server Backups - Azure Storage Uploader Script.
# Inspired by
import os
from import BlobServiceClient, BlobClient, ContainerClient, __version__
# Make sure you update this per server
CONTAINER_NAME = 'mcbackups1'
print("Azure Blob storage v" + __version__ + " - Python quickstart sample")
halfnibble / webpack.config.js
Created June 22, 2020 17:23
Add file-loader to webpack config.
View webpack.config.js
const path = require('path')
const ExtractTextWebpackPlugin = require('extract-text-webpack-plugin')
const { postLogin, postArticle } = require('./js/api')
const express = require('express')
module.exports = {
mode: 'development',
entry: {
'app': './js/index.js',
'styles': './sass/styles.sass'
halfnibble / htmlToAST.js
Last active December 27, 2021 14:59
GraphCMS HTML to RichTextAST
View htmlToAST.js
const { jsx } = require('slate-hyperscript')
const { JSDOM } = require('jsdom')
const DOMParser = new JSDOM().window.DOMParser
* Parses and returns a Rich Text AST object for use in GraphCMS.
* @param {HTML} html string, e.g. `<p>hi there</p>`
const htmlToAST = html => {
halfnibble / HashFunction.ts
Last active October 13, 2023 11:35
Hash function to debug absolute paths sent to the update chunk hash method in webpack.
View HashFunction.ts
import * as crypto from 'crypto';
import * as fs from 'fs';
import * as path from 'path';
* Interface for Webpack's hashFunction
export interface IHashFunction {
update: (data: string | Buffer, encoding: string) => IHashFunction;
digest: (encoding: string) => string | Buffer;
halfnibble / index.html
Created June 27, 2019 00:32
Example code so far.
View index.html
<!DOCTYPE html>
<title>My JavaScript Test</title>
<h1 id="page-header">
halfnibble / main.scss
Created April 24, 2019 17:44
SCSS for responsive nav
View main.scss
@import "bourbon/bourbon";
@import "colors";
@import url('');
@import "grid";
@import "utils";
$parent_menu_items: 3;
$submenu_menu_items: 4;
html, body {
halfnibble / main.js
Created April 24, 2019 17:41
Responsive nav jQuery code
View main.js
$(document).ready(function() {
let menu = $('nav > ul'),
menuLink = $('#mobile-menu a');
menuLink.on('click', function() {
if (menu.hasClass('closed')) {
} else {
halfnibble / index.html
Created April 24, 2019 17:40
Menu HTML responsive nav
View index.html
<ul class="closed">
<li id="mobile-menu" class="mobile-only">
<a href="#">
<div id="hamburger"></div>