Skip to content

Instantly share code, notes, and snippets.

@kevinchampion
kevinchampion / drupal_jquery_replace.php
Created March 6, 2015 01:17
Manual Drupal jQuery version change using hook_js_alter().
/**
* Implements hook_js_alter().
*/
function invideous_ooyala_integration_js_alter(&$javascript) {
$node = menu_get_object();
if (!empty($node) && $node->type == 'event') {
$state = _eversport_videofield_get_state($node);
<?php
/**
* @file
* Default theme implementation for beans.
*
* Available variables:
* - $content: An array of comment items. Use render($content) to print them all, or
* print a subset such as render($content['field_example']). Use
* hide($content['field_example']) to temporarily suppress the printing of a
* given element.
@kevinchampion
kevinchampion / keybase.md
Created October 25, 2014 22:03
Keybase.io proof

Keybase proof

I hereby claim:

  • I am kevinchampion on github.
  • I am kevinchampion (https://keybase.io/kevinchampion) on keybase.
  • I have a public key whose fingerprint is 8420 A445 C7CA F069 478D 11AF D941 9AD1 21F9 1CC1

To claim this, I am signing this object:

@kevinchampion
kevinchampion / ng-ckeditor.js
Created June 20, 2014 01:51
ckeditor angular directive
(function(angular, factory) {
if (typeof define === 'function' && define.amd) {
define(['angular', 'ckeditor'], function(angular) {
return factory(angular);
});
} else {
return factory(angular);
}
}(angular || null, function(angular) {
var app = angular.module('ngCkeditor', []);
@kevinchampion
kevinchampion / buildsrepos_setup_steps.sh
Created March 5, 2014 17:26
Builds repo project provision
1. Provision new vhost
2. Add CNAME record in rackspace
3. Create database and grant new mysql user full rights to it
## Steps for initial setup of buildsrepos
1. Create headless repo in correct directory
2. Create builds repo in correct directory
3. Copy .gitignore, commit, checkout new branch
@kevinchampion
kevinchampion / isu_faculty.install
Created February 21, 2014 21:55
ISU faculty feature module update hooks
<?php
/**
* Change the weight of this module.
*/
function isu_faculty_update_7000() {
db_query("UPDATE {system} SET weight = 88 WHERE name = 'isu_faculty'");
}
/**
@kevinchampion
kevinchampion / dl_private_github_file.sh
Created January 25, 2014 00:34
Downloads a file from a private repo on GitHub
#!/bin/bash
USER="$1"
PROJECT="$2"
FILE="$3"
DESTINATION="$4"
TOKEN="$5"
REF="$6"
FILEDATA=$(curl https://api.github.com/repos/${USER}/${PROJECT}/contents/${FILE}?access_token=${TOKEN}&REF=${ref})
@kevinchampion
kevinchampion / install.inc
Created January 24, 2014 19:43
Modified install.inc
<?php
/**
* @file
* API functions for installing modules and themes.
*/
/**
* Indicates that a module has not been installed yet.
*/
@kevinchampion
kevinchampion / ckeditor_media.make
Created January 20, 2014 04:27
Ckeditor and media make
; Contributed modules.
projects[ckeditor][version] = "1.x-dev"
projects[ckeditor][type] = "module"
projects[ckeditor][subdir] = "contrib"
projects[ckeditor][download][type] = "git"
projects[ckeditor][download][revision] = "57245a9"
projects[ckeditor][download][branch] = "7.x-1.x"
; Integration with Media 2.x
; http://drupal.org/node/1504696
@kevinchampion
kevinchampion / jenkins-tag-build.sh
Created December 12, 2013 00:19
Jenkins builds repo
CLIENT="$1"
SITE="$2"
VHOST="$3"
cd /var/www/vhosts/${VHOST}/public
# Remove all the gitignores
find . -name ".gitignore" -print0 | xargs -0 rm
# Create repo