Skip to content

Instantly share code, notes, and snippets.

View kalenjohnson's full-sized avatar

Kalen Johnson kalenjohnson

View GitHub Profile
var affix = $('#affix-container');
affix.affix({
offset: {
top: function() {
if ($('#carousel-motivate').length !== 0) {
if ($('body').hasClass('admin-bar')) {
return (
$('#wpadminbar').outerHeight() +
@kalenjohnson
kalenjohnson / cherry-pick-git
Created April 25, 2015 23:19
Cherry pick upstream to subdirectory
git cherry-pick -Xsubtree=<subdirectory> 517be2a88318de51f51397066575ab07fae825a1 --strategy=recursive -X <theirs>
@kalenjohnson
kalenjohnson / gist:0e5805894a75bcec0204
Last active June 1, 2016 20:36
Codeship Deploy to WPEngine
REMOTE_REPOSITORY=${REMOTE_REPOSITORY:?'You need to configure the REMOTE_REPOSITORY environment variable!'}
REMOTE_BRANCH=${REMOTE_BRANCH:?'You need to configure the REMOTE_BRANCH environment variable!'}
set -e
git fetch --unshallow || true
git push ${REMOTE_REPOSITORY} ${CI_COMMIT_ID}:${REMOTE_BRANCH}
cd wp-content/themes/<theme>
npm install -g bower gulp
npm install
bower install
gulp --production
@kalenjohnson
kalenjohnson / row.php
Created June 12, 2015 18:21
Row Helper
<?php
/**
* Keep track of the amount of items in a row, and add another .row when necessary
*
* @param int $i
* @param int $item_count
* @param string $class_name
*
* @return bool|string
### Keybase proof
I hereby claim:
* I am kalenjohnson on github.
* I am kalenjohnson (https://keybase.io/kalenjohnson) on keybase.
* I have a public key whose fingerprint is C700 BAD5 FD8D 6FFF DEB1 FF1F F24E 0E71 AC8E 1CDE
To claim this, I am signing this object: