Skip to content

Instantly share code, notes, and snippets.

View adamcjoiner's full-sized avatar

Adam C. Joiner adamcjoiner

View GitHub Profile
@adamcjoiner
adamcjoiner / draggable-bootstrap-modal-window.markdown
Created July 8, 2025 17:25
Draggable Bootstrap Modal Window
@adamcjoiner
adamcjoiner / gpt-prompt_solve-method-v3.4.md
Created July 4, 2025 20:42
GPT Prompt: Modular Problem Solving Equation and Formulaic Instructions For Use

Final Modular Problem-Solving Method with Dynamic Adaptation & Transparent Calculations (v3.3)

Conceptual Overview

This method assumes that a complex problem can be decomposed into discrete modules. Each module’s contribution is computed by multiplying its:

  • Activity Indicator (A(M_i)): A value (0–1) denoting how critical the module is.
  • Resource Allocation (R(M_i)): The portion of total available resources dedicated to the module, subject to:
    [ \sum_{i=1}^{n} R(M_i) \le R_{\text{total}} ]
@adamcjoiner
adamcjoiner / brainhub-developer-toolbox.markdown
Last active September 19, 2023 15:40
BrainHub / Developer Toolbox
$(function() {
$('.login_button').click(function() {
doLogin();
});
$('#send_chat_form').submit(function() {
var message = $(this).find('.message').val();
sendMsg(message);
$('#chat').append('<div class="msg">me: ' + message + '</div>');
$(this).find(".message").val('');
@adamcjoiner
adamcjoiner / rest-endpoint-html.js
Created October 30, 2019 14:12
REST endpoint with HTML response (Node.js+Express.js)
var express = require('express');
var app = express();
var port = 3010;
var title = 'Homepage';
var home = '<h1>'+title+'</h1>';
app.get('/', function (req, res) {
@adamcjoiner
adamcjoiner / custom-template.php
Created May 23, 2019 22:08
A boilerplate custom page template file for Wordpress child themes
<?php
/*
Template Name: Custom Page Template
Author: Adam C. Joiner
Note: This template can be utilized by selecting it from the "Page Template" dropdown on the right hand side of the Wordpress page editor screen and then clicking Save.
*/
get_header();
/* Page content goes here */
@adamcjoiner
adamcjoiner / log.js
Last active March 23, 2019 12:04
Adds on/off capability and custom message coloring to console logs.
/*
Module Name: LogJS
Description: Adds on/off and custom coloring functions to console logs
Author: Adam C. Joiner
Author URI: http://www.adamcjoiner.com/
Usage: log.on(); // off by default
log.post('message') // log to console in white text
log.debug('email sent successfully'); // gray text
log.info('sending email'); // yellow text
log.warning('server responded with no data');
@adamcjoiner
adamcjoiner / secure.php
Last active October 11, 2020 23:36
PHP: Simple password protected page with md5 (found on: https://stackoverflow.com/questions/4115719/easy-way-to-password-protect-php-page)
<?php
$user = $_POST['user'];
$pass = md5($_POST['pass']);
$hash = "enter your md5 hash here";
if($user == "admin"
&& $pass == $hash)
{
echo "Secure content:";
include("content.html");
@adamcjoiner
adamcjoiner / jquery.checkurl.js
Last active November 19, 2024 09:09
Use jQuery's $.ajax to ping a URL and report the response
$.ajax({url: "http://www.google.com/",
type: "HEAD",
timeout:1000,
statusCode: {
200: function (response) {
console.log('Status 200: Page is up!');
},
400: function (response) {
console.log('Status 400: Page is down.');
},
@adamcjoiner
adamcjoiner / wp-admin-modal-dialog.php
Created June 6, 2018 20:38 — forked from anttiviljami/wp-admin-modal-dialog.php
WordPress admin modal dialog example
<?php
// enqueue these scripts and styles before admin_head
wp_enqueue_script( 'jquery-ui-dialog' ); // jquery and jquery-ui should be dependencies, didn't check though...
wp_enqueue_style( 'wp-jquery-ui-dialog' );
?>
<!-- The modal / dialog box, hidden somewhere near the footer -->
<div id="my-dialog" class="hidden" style="max-width:800px">
<h3>Dialog content</h3>
<p>This is some terribly exciting content inside this dialog. Don't you agree?</p>