Skip to content

Instantly share code, notes, and snippets.

View chriswburke's full-sized avatar
🕹️
ᕙ(⇀‸↼‶)ᕗ

Chris W. Burke chriswburke

🕹️
ᕙ(⇀‸↼‶)ᕗ
View GitHub Profile
@chriswburke
chriswburke / nvm_auto_switching.sh
Created January 9, 2020 02:40 — forked from tribou/nvm_auto_switching.sh
Use PROMPT_COMMAND and nvm to auto-switch versions of node
#!/bin/bash
# Activate a version of Node that is read from a text file via NVM
function use_node_version()
{
local TEXT_FILE_NAME="$1"
local CURRENT_VERSION=$([ -n "$HAS_NVM" ] && nvm current)
local PROJECT_VERSION=$([ -n "$HAS_NVM" ] && nvm version $(cat "$TEXT_FILE_NAME"))
# If the project file version is different than the current version
<amp-analytics>
<script type="application/json">
{
"requests": {
"pageview": "https://keystone.sitecore81u1/?url=${canonicalUrl}&title=${title}&acct=${account}",
"event": "https://keystone.sitecore81u1/?eid=${eventId}&elab=${eventLabel}&acct=${account}"
},
"vars": {
"account": "ABC123"
},
@chriswburke
chriswburke / keystone2heroku.md
Created November 21, 2016 01:11 — forked from vitalbone/keystone2heroku.md
Deploying KeystoneJS to Heroku

Deploying a Keystone App to Heroku

Keystone comes completely set up to install on Heroku in a couple of steps.

1. Sign up for a Heroku account and install the Heroku Toolbelt.

Log in with it and you're ready to begin. Heroku uses git to deploy a new site, so with that in mind:

2. Create a new repository on Github and then clone it.

@chriswburke
chriswburke / bash-script-git.sh
Created August 11, 2016 23:38 — forked from salcode/bash-script-git.sh
Notes for bash scripting git commands
# Current branch - Determine current git branch, store in $currentbranch, and exit if not on a branch
if ! currentbranch=$(git symbolic-ref --short -q HEAD)
then
echo We are not currently on a branch.
exit 1
fi
# Uncommited Changes - Exit script if there uncommited changes
if ! git diff-index --quiet HEAD --; then
echo "There are uncommited changes on this repository."
#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/
var app = angular.module('app', ['ngResource']);
app.config(function($locationProvider, $routeProvider) {
// $locationProvider.html5Mode(true);
$routeProvider
.when('/', { templateUrl: 'partials/index', controller: 'ctrl' })
.when('/about', { templateUrl: 'partials/about', controller: 'ctrl' })
.otherwise({redirectTo:'/'});
});
// Modified Isotope methods for gutters in masonry
$.Isotope.prototype._getMasonryGutterColumns = function() {
var gutter = this.options.masonry && this.options.masonry.gutterWidth || 0;
containerWidth = this.element.width();
this.masonry.columnWidth = this.options.masonry && this.options.masonry.columnWidth ||
// Or use the size of the first item
this.$filteredAtoms.outerWidth(true) ||
// If there's no items, use size of container
containerWidth;