Skip to content

Instantly share code, notes, and snippets.

View erictompkins's full-sized avatar

Eric Tompkins erictompkins

View GitHub Profile
@erictompkins
erictompkins / instructions.md
Last active May 1, 2020 12:48
Migration from BitBucket to Github

How to migrate a Git repository from BitBucket to GitHub

  1. Create the new repository in GitHub.

  2. Make sure that you've checked out the code to your computer.

 git clone https://[email protected]/USER/PROJECT.git

Or, if you already have the code checked out just pull.

@erictompkins
erictompkins / .htaccess
Created April 30, 2020 14:37 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@erictompkins
erictompkins / theme.json
Last active November 22, 2019 13:25
BranchCMS Theme Configuration Example
{
"name": "Custom theme",
"settings": {
"groups": [
{
"name": "Group Name",
"description": "Group description",
"fields": [
{
"name": "text_field",
@erictompkins
erictompkins / trail-search-results-content-template.txt
Created November 11, 2016 12:10
BranchCMS Trails App :: Trail search result pageTrail Search Results Content Template
<h1>Search Results</h1>
{** map-canvas is where the map will be displayed **}
<div id="map-canvas" style="height: 500px;"></div>
{** Set the trail ids to be used in trail-search-results.js **}
<script>
if (typeof trailIds === 'undefined') {
var trailIds = [];
}
@erictompkins
erictompkins / trail-search-results.js
Last active November 11, 2016 12:07
BranchCMS Trails App :: Trail search result page Javascript for Google Map
/**
* Holds the ids of the trails matched in the search.
* Depending on where you have your Javascript in the search results content template
* that sets the list of trail ids, the trailIds variable may already be setup.
*/
if (typeof trailIds === 'undefined') {
var trailIds = [];
}
/**
@erictompkins
erictompkins / trail-search-results-ajax-content-layout.txt
Last active November 11, 2016 11:50
BranchCMS Trails App :: Content Layout to process the POST AJAX submission and call the correct APIs
{if #global.request.post.id}
{if #global.request.post.id isArray}
{#global.request.post.id|implode glue="," output="no" saveAs="id"}
{else}
{#id|set value="{#global.request.post.id}"}
{/if}
{if #id}
{ap_api:trails:trailFilter templateId="35" getTowns="yes" getCategories="no" getCounties="no" getContacts="no" getFeatures="no" getSegments="no" instanceKey="trails" attr[id]="{#id}"}
{/if}
{elseif #global.request.get.id}
@erictompkins
erictompkins / trail-list.js
Created September 14, 2016 18:34
BranchCMS Trails App :: Trail list page Javascript for Google Map
function initTrailList() {
initMap(function() {
loadSegments();
});
}
function loadSegments() {
$.getJSON('/trail-list', function (data) {
features = data.trailPoints;
setupMarkers();
@erictompkins
erictompkins / trail-filter-api-ajax-list-segments-content-template.txt
Created September 14, 2016 18:27
BranchCMS Trails App :: Trail Filter API for loading trails to the app home and trail list page
{#trailPoints|array}
{loop items="#trails" value="trail"}
{** Set up the individual trail data **}
{#trailPoint|set key="name" value="{#trail.trailSystemName}"}
{#trailPoint|set key="lat" value="{#trail.markerLatitude}"}
{#trailPoint|set key="lng" value="{#trail.markerLongitude}"}
{#trailPoint|set key="url" value="{#trail.url}"}
{#trail.abstract|striptags saveAs="abstract" output="no"}
{#trailPoint|set key="abs" value="{#abstract|escapeQuotes single='no'}"}
@erictompkins
erictompkins / trail-detail.js
Created September 14, 2016 16:10
BranchCMS Trails App :: Trail detail page Javascript for Google Map
function initTrailDetail() {
initMap(function() {
setupMarkers();
setupSegments();
});
}
/**
* Initialize the map
*/
@erictompkins
erictompkins / map.js
Last active September 14, 2016 18:24
BranchCMS Trails App :: Showing a Google map for trail pages - map.js
var map,
features = [],
segments = [],
latitude = 43.6, // Center point for map
longitude = -72.4, // Center point for map
zoom = 10;
/**
* Main method to setup the map
*