Skip to content

Instantly share code, notes, and snippets.

<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3862.232860650702!2d-96.05830259683584!3d30.411761145794625!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x8646eac791b36a7f%3A0xa32b75df03247921!2s5808%20FM%203455%20Rd%2C%20Navasota%2C%20TX%2077868!5e0!3m2!1sen!2sus!4v1658416812206!5m2!1sen!2sus" width="100%" height="350" style="border:0;" allowfullscreen="" loading="lazy" referrerpolicy="no-referrer-when-downgrade"></iframe>
@jer0dh
jer0dh / script.py
Created January 6, 2022 23:05
Hurricane's project from Codecademy
# names of hurricanes
names = ['Cuba I', 'San Felipe II Okeechobee', 'Bahamas', 'Cuba II', 'CubaBrownsville', 'Tampico', 'Labor Day', 'New England', 'Carol', 'Janet', 'Carla', 'Hattie', 'Beulah', 'Camille', 'Edith', 'Anita', 'David', 'Allen', 'Gilbert', 'Hugo', 'Andrew', 'Mitch', 'Isabel', 'Ivan', 'Emily', 'Katrina', 'Rita', 'Wilma', 'Dean', 'Felix', 'Matthew', 'Irma', 'Maria', 'Michael']
# months of hurricanes
months = ['October', 'September', 'September', 'November', 'August', 'September', 'September', 'September', 'September', 'September', 'September', 'October', 'September', 'August', 'September', 'September', 'August', 'August', 'September', 'September', 'August', 'October', 'September', 'September', 'July', 'August', 'September', 'October', 'August', 'September', 'October', 'September', 'September', 'October']
# years of hurricanes
years = [1924, 1928, 1932, 1932, 1933, 1933, 1935, 1938, 1953, 1955, 1961, 1961, 1967, 1969, 1971, 1977, 1979, 1980, 1988, 1989, 1992, 1998, 2003, 2004, 2005, 2005, 2005, 2
@jer0dh
jer0dh / ajax.js
Created November 27, 2021 19:31
Javascript used for Wordpress theme using Elementor to update articles on archive template
String.prototype.toSlug = function ()
{
var str = this;
str = str.replace(/^\s+|\s+$/g, ''); // trim
str = str.toLowerCase();
// remove accents, swap ñ for n, etc
var from = "àáäâèéëêìíïîòóöôùúüûñçěščřžýúůďťň·/_,:;";
var to = "aaaaeeeeiiiioooouuuuncescrzyuudtn------";
@jer0dh
jer0dh / gist:a9f4c7bda1e8308e082f0fee3488c0f5
Last active November 15, 2021 14:24
Convert Google Doc to basic HTML and other things. On Codepen.io
<!-- Use preprocessors via the lang attribute! e.g. <template lang="pug"> -->
<template>
<div id="app">
<div class="control1">
<textarea id="tiny" style="height:30vh;width:100%"></textarea>
<textarea v-if="isRawHTML" v-model="rawHTML" style="height:30vh; width: 100%" placeholder="Raw HTML"></textarea>
<div class="control2">
<div>
@jer0dh
jer0dh / gist:324f3a9a5f421eb6415a0a110613237a
Created October 21, 2021 21:48
Some css and javascript for a Themify solution to change row shown on hover on buttons
<style>
/* Add CSS class, jp-hover-slide, to each row. Add an ID of jp-hover-slide-?, where ? is the slide number.
* On the buttons, give each a class of jp-hover-button and make the id unique and end it with the slide number..ex. jp-button-1
* Add .jp-full-height to the column containing the button to make the buttons all identical in height no matter the text content
*/
body:not(.themify_builder_active) .jp-hover-slide {
display: none;
opacity: 0;
transition: all 1.3s;
@jer0dh
jer0dh / gist:5bc1bd34cca11575bfe8d5f0faf6b9aa
Last active July 26, 2021 22:43
Wordpress Snippet: Shortcode to loop through custom post type with pagination
<?php
/**
* Edited loop code from: https://wpza.net/how-to-paginate-a-custom-post-type-in-wordpress/
*/
add_shortcode( 'display_whitepapers', 'sz_display_whitepapers_shortcode' );
function sz_display_whitepapers_shortcode( $atts) {
@jer0dh
jer0dh / mockTweets.js
Last active January 14, 2018 21:36
A modification for 'React.js Essentials' book. - no need for snapkite-engine server
/* I wrote this to help me with the project in the React.js Essentials book by Artemij Fedosejev.
I couldn't get the snapkite-engine to work but wanted to test the project out on my machine.
So this can be added to the project so you don't have to create the snapkite-engine server.
You only have to change one require statement in the Stream.react.js file. */
/* create a mockTweets.js file in the source/components directory of the project */
/*
in the /source/components/Stream.react.js file, change the line that starts with 'var SnapkiteStreamClient='
to the following:
@jer0dh
jer0dh / gist:9809e983edb4617300e8
Last active August 29, 2015 14:18
Layout CSS/SASS for Genesis Framework CSS conversion to Bootstrap CSS
//by Jerod Hammerstein
//My layout SASS to change the default WordPress Genesis Framework css to use Bootstrap css
//Requires Bootstrap SASS at https://github.com/twbs/bootstrap-sass
//Updated: 20150409 - added offsets and padding
// padding on the left and right of the full page
$page_padding: 10px;
// Calculating the column sizes for content-sidebar-wrap, sidebars, and content
// Genesis markup is always the following with the aside (sidebars) elements optional
@jer0dh
jer0dh / grid.js
Last active August 29, 2015 14:11
grid creation with filter
/* jhGrid.js
by jerod hammerstein
jhtechservices.com
Used to create a grid structure out of a listing of WordPress posts using the display_posts_shortcode by Bill Erickson
It also will look for an element with a comma-delimited list of filters or tags in each post and using those
fill in a dropdown box that will filter the list based on its selection.
With the following Filter Hook, I was able to make this list contain an element with a comma-delimited list of the
tags a post has. (Modified version of Bill Erickson's https://gist.github.com/billerickson/1175575#file_display_posts_shortcode_output.php)