Skip to content

Instantly share code, notes, and snippets.

@joshuacc
joshuacc / gist:1246145
Created September 27, 2011 20:29
Google Analytics for GU
CURRENT VERSION
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(
/*Site Trackers*/
['_setAccount', 'UA-11510242-21'],
['_trackPageview'],
['legacy._setAccount', 'UA-1433013-7'],
@joshuacc
joshuacc / gist:1246253
Created September 27, 2011 21:07
Updated GU Analytics
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(
/*Site Trackers*/
['_setAccount', 'UA-11510242-21'],
['_trackPageview'],
['legacy._setAccount', 'UA-1433013-7'],
['legacy._trackPageview'],
/*Multi-Site Trackers*/
@joshuacc
joshuacc / timeline.js
Created November 10, 2011 16:11
Updated GU Campaign
// JavaScript Document
//console fix for IE or other browsers that don't have a console
if(typeof(console)!='undefined'){
//console exists, do nothing
} else {
//console doesn't exist, create it and create console.log
var console=new Object();
console.log=function(o){
//window.status=o.toString();
}
@joshuacc
joshuacc / checkbox-behavior.js
Created December 12, 2011 21:46
checkbox behavior
// When the final report checkbox is clicked
$('table.detailed input[type="checkbox"].final-report').click(function() {
// Find the associated optional and midyear report checkboxes
var $opt_mid = $this.parents('table.detailed').children('input[type="checkbox"]').filter('.optional-report, .midyear-report');
// If the final report checkbox is checked
if ( $(this).is(':checked') ) {
// For each optional/midyear checkbox
@joshuacc
joshuacc / jshint-config.json
Created January 18, 2012 16:49
JS Pre-commit hook
{
// Settings
"passfail" : false, // Stop on first error.
"maxerr" : 100, // Maximum error before stopping.
// Predefined globals whom JSHint will ignore.
"browser" : true, // Standard browser globals e.g. `window`, `document`.
"node" : false,
# These files are ignored by git
# App Configuration #
#####################
.htaccess
/config/
/core/config/config.xml
/wk12/includes/configuration.php
/wk12/district/course-planner/index.php
/includes/naviance_network_class.php
@joshuacc
joshuacc / CoffeeScript.sublime-build
Created March 13, 2012 17:21
Sublime Text 2 Preferences
{
"cmd": ["coffee","-c","$file"],
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
"selector": "source.coffee",
"windows":
{
"cmd":["coffee.cmd"]
}
}
@joshuacc
joshuacc / gist:2036543
Created March 14, 2012 13:40
Scrum snippet for Sublime Text 2
<snippet>
<content><![CDATA[
Josh's Update ${1:DATE}
===========================
<< Previous
+ ${2}
Today >>
+ ${3}
@joshuacc
joshuacc / gist:2258630
Created March 31, 2012 02:10
isitgoodjs
#!/bin/bash
if [ "$1" == "" ]; then
echo -e "\e[00;32mPlease specify a JavaScript file to check."
exit 1
fi
git rev-parse --git-dir 1>/dev/null 2>&1
if [ $? != 0 ]; then
echo -e "\n\033[00;41;30mYou are not in a git repository.\033[00m\n"
exit 1
@joshuacc
joshuacc / defaultViewFacade.sublime-snippet
Created June 21, 2012 22:54
defaultViewFacade autocomplete snippets
<snippet>
<content><![CDATA[
\$defaultViewFacade = new Succeed_Web_DefaultView('${1:SECTION} ${2:SUBSECTION} ${3:PAGE}', '${4:TITLE}');
echo \$defaultViewFacade->render();
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>defaultv</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<!-- <scope>source.python</scope> -->