Skip to content

Instantly share code, notes, and snippets.

View regan008's full-sized avatar

Amanda Regan regan008

View GitHub Profile
library(ggmap)
library(ggplot2)
library(tidygeocoder)
library(tidyverse)
## what is geocoding?
rec.data <- read.csv("https://raw.githubusercontent.com/regan008/DigitalMethodsData/main/raw/Recreation-Expenditures.csv")
rec.data$geocode.address <- paste(rec.data$city, ", ", rec.data$state, sep="")
@regan008
regan008 / Custom-Field-Output.php
Last active September 19, 2016 19:37
Code to output a statement at the bottom of a post in a PressFoward publication.
#This is the code to generate a custom statement at the bottom of a post using WordPress Custom Fields. To get this code to work properly you must do 2 things:
#First, you need to create custom fields and enter the name of the fields in the get_post_meta function below. In this example the custom field names are 'Editors-at-large' and 'Editor-in-chief'. You can change the variable name (the part that begins with $) to whatever you would like, just be sure to change it throughout this code snippet.
#Second, you must place this content inside the loop in your single.php template. Below, the code on lines 07 through 10 is the custom code to generate the statement the code on lines 05 and 12 represents the post loop.
<?php while (have_posts()) : the_post() ?>
$edsatlarge = get_post_meta($post->ID, 'editors-at-large', true);
$eic = get_post_meta)$post-ID, 'editor-in-chief', true);
echo 'This content was selected for Digital Humanities Now by' . $eic . 'based on nominations by Editors-at-Large:' . $edsatlarge
@regan008
regan008 / header.php
Created August 4, 2016 22:35
Code to add a search form to the navbar of the flat bootstrap WordPress theme. If you are using a child theme, this entire file should be copied into your child theme folder.
<?php
/**
* Theme: Flat Bootstrap
*
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="content">
*
* @package flat-bootstrap
*/
@regan008
regan008 / opmltest.xml
Created November 10, 2015 17:36
Test OPML
<opml version="1.1">
<head>
<title>
Generated by FeedShow OMPLBuilder: Tue, 10 Nov 2015 17:57:18 +0100
</title>
<dateCreated>Tue, 10 Nov 2015 17:57:18 +0100</dateCreated>
</head>
<body>
<outline text="Main Folder">
<outline title="chronicle.com/blogs/profhacker/feed" text="chronicle.com/blogs/profhacker/feed" type="rss" xmlUrl="http://chronicle.com/blogs/profhacker/feed"/>
<?php
// WP_User_Query arguments. Search the database for the values from the pie checkbox.
//dhnoq this value is pie_checkbox_6
$args = array (
'meta_query' => array(
array(
'key' => 'pie_checkbox_6',
),
<pre>array(19) { ["rss_0"]=> array(15) { ["item_title"]=> string(69) "ACE Adventure Resort Offers Students Learning Through STEM Curriculum" ["source_title"]=> string(42) "Google Alert - "citizen science"" ["item_date"]=> string(31) "Mon, 24 Aug 2015 15:56:15 +0000" ["item_author"]=> string(0) "" ["item_content"]=> string(165) "WET AND WILD H2O - Students raft the New River Gorge collecting data for a citizen science water quality project. This is a journey through time that ..." ["item_link"]=> string(276) "https://www.google.com/url?rct=j&sa=t&url=http://www.broadwayworld.com/bwwtravel/article/ACE-Adventure-Resort-Offers-Students-Learning-Through-STEM-Curriculum-20150824&ct=ga&cd=CAIyGmNmYjI1ODc2ZmQ5ZGM2ZTY6Y29tOmVuOlVT&usg=AFQjCNEigUXzn9U5sWWapcW5U0uXVUUFzA" ["item_feat_img"]=> string(0) "" ["item_id"]=> string(32) "1e37632e0943e6295d35001ba32fcfa9" ["item_wp_date"]=> string(10) "2015-08-24" ["item_tags"]=> string(0) "" ["item_added_date"]=> string(0) "" ["source_repeat"]=> string(0) "" ["post_id"]=> strin
@regan008
regan008 / CitizenScience-GoogleAlertError.html
Last active August 29, 2015 14:28
Debugging the citizen science Google Alert issue.
var_dump(pressforward()->modules['rss-import']->get_data_object(get_post(893)));
<pre> array(19) { ["rss_0"]=> array(15) { ["item_title"]=> string(69) "ACE Adventure Resort Offers Students Learning Through STEM Curriculum" ["source_title"]=> string(42) "Google Alert - "citizen science"" ["item_date"]=> string(31) "Mon, 24 Aug 2015 15:56:15 +0000" ["item_author"]=> string(0) "" ["item_content"]=> string(165) "WET AND WILD H2O - Students raft the New River Gorge collecting data for a citizen science water quality project. This is a journey through time that ..." ["item_link"]=> string(276) "https://www.google.com/url?rct=j&sa=t&url=http://www.broadwayworld.com/bwwtravel/article/ACE-Adventure-Resort-Offers-Students-Learning-Through-STEM-Curriculum-20150824&ct=ga&cd=CAIyGmNmYjI1ODc2ZmQ5ZGM2ZTY6Y29tOmVuOlVT&usg=AFQjCNEigUXzn9U5sWWapcW5U0uXVUUFzA" ["item_feat_img"]=> string(0) "" ["item_id"]=> string(32) "1e37632e0943e6295d35001ba32fcfa9" ["item_wp_date"]=> string(10) "2015-08-24" ["item_tags"]=> string(0) "" ["it