Skip to content

Instantly share code, notes, and snippets.

@thirdender
thirdender / keybase.md
Created January 16, 2022 16:15
keybase.md

Keybase proof

I hereby claim:

  • I am thirdender on github.
  • I am thirdender (https://keybase.io/thirdender) on keybase.
  • I have a public key ASAY5RnbNEBj4JhvOgxFWEX7pWVnQR0Xq3g8mdj2JDx_XQo

To claim this, I am signing this object:

@thirdender
thirdender / resume.json
Created April 1, 2020 23:35
Robert Rothermel's resume
{
"basics": {
"name": "Robert Rothermel",
"label": "Web Developer",
"image": "https://www.gravatar.com/avatar/1d997a7646756c8db374434e8ccd7444?s=480",
"summary": "Full stack developer with a focus on React SPA on AWS. I have many years experience with multiple e-commerce platforms and PHP CMS solutions. My preferred language is JavaScript in both the browser and backend.",
"website": "https://thirdender.io",
"email": "[email protected]",
"location": {
"city": "Sugar Notch",
@thirdender
thirdender / gist:7533792
Last active December 28, 2015 17:09
Build a Drupal 7 node form using the FAPI
<?php
/**
* This leverages the node and form APIs to output a node add form. It can be
* used as part of a hook_menu page callback, or output in any part of the
* page.
*/
// Create the empty $node object (replace CONTENT_TYPE with the machine name
// of your node type)
$node = new StdClass();
@thirdender
thirdender / script.js
Created September 6, 2013 17:42
Make the Next and Previous navigation reload the main section of a page using jQuery.load. history.pushState is used to keep the URL in the location bar up to date, and the loading of the content is done with a touch of animation.
// History logic: http://adhockery.blogspot.com/2011/02/javascripts-history-object-pushstate.html
if (history.pushState) {
var selector = "#main",
loadSelector = " " + selector + " > *",
container = $(selector).on("click", "nav[role='pagenavigation'] a", function() {
var href = $(this).attr("href");
$("html, body").animate({ "scrollTop": 0 }, 400);
history.pushState({ "path": href }, null, href);
container.
animate({ "opacity": 0 }, 400).
@thirdender
thirdender / gist:1725514
Created February 2, 2012 20:16
Example fragment loading using pjax: https://github.com/defunkt/jquery-pjax
// Handle previous/next navigation
$(function() {
// Requires jQuery 1.7+ to utilize the new "on" event attachment
$("#contentPadding").on("click", "a.prev, a.next", function (event) {
$.pjax({
"url": $(this).attr("href"),
"fragment": "#contentPadding",
"container": "#contentPadding",
"complete": function(data) {
// Update the className on the BODY tag
@thirdender
thirdender / bootstrap.php
Created January 23, 2012 23:12
Code to get current URL after Apache redirect (taken from Drupal's bootstrap.inc)
function request_path() {
static $path;
if (isset($path)) {
return $path;
}
if (isset($_GET['q'])) {
// This is a request with a ?q=foo/bar query string. $_GET['q'] is
// overwritten in drupal_path_initialize(), but request_path() is called
@thirdender
thirdender / gist:1567235
Created January 5, 2012 20:54
Extend a Cargo CMS specific Javascript function
var openThisPrInline = (function() {
// Store the existing function
var oldFunction = window.openThisPrInline;
// Return a new function
return function(data) {
// Run the old code
oldFunction(data);
// Start jScrollPane if #section-scroll exists
@thirdender
thirdender / WPInvoice notification code
Created January 4, 2012 00:09
WPInvoice notification code (unfinished)
<?php
function reminder_invoice_notification($wpi_settings) {
global $wpi_settings;
// Output the invoice selection field in the settings
$rinotify .= '<table><tr><th>Select Invoice Template to use:</th><td>';
$rinotify .= '<select id="wpi_change_notification">';
foreach ($wpi_settings['notification'] as $key => $item) {
$rinotify .= "<option value=\"$key\">{$item['name']}</option>";