This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function syntaxHighlight(json) { | |
if (typeof json != 'string') { | |
json = JSON.stringify(json, undefined, 2); | |
} | |
json = json.replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>'); | |
return json.replace(/("(\\u[a-zA-Z0-9]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?)/g, function (match) { | |
var cls = 'number'; | |
if (/^"/.test(match)) { | |
if (/:$/.test(match)) { | |
cls = 'key'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function getUrlVars (url) { | |
var vars = [], hash, $href, hashes, i; | |
$href = (url !== undefined) ? url : exp.location.href; | |
hashes = $href.slice($href.indexOf('?') + 1).split('&'); | |
for (i = 0; i < hashes.length; i += 1) { | |
hash = hashes[i].split('='); | |
vars.push(hash[0]); | |
vars[hash[0]] = hash[1]; | |
} | |
return vars; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function parseQueryString (qs) { | |
if(arguments.length==0) { | |
qs = exp.location.href; | |
} | |
var e, | |
a = /\+/g, // Regex for replacing addition symbol with a space | |
r = /([\w]+)=?([\w]*)/g, | |
d = function (s) { return decodeURIComponent(s.replace(a, " ")); }, | |
urlParams = {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint browser:true */ | |
/*global document */ | |
/** | |
* @author ferron on 10/21/13. | |
* Adapted from http://stackoverflow.com/questions/17211466/how-can-i-simulate-a-click-event-in-my-angularjs-directive-test | |
* a simple trigger mechanism to allow testing of events to work inside phamtomjs | |
*/ | |
function evTrigger(element, event) { | |
"use strict"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
(function () { | |
var msie = parseInt((/msie (\d+)/.exec(navigator.userAgent.toLowerCase()) || [])[1], 10); | |
function indexOf(array, obj) { | |
if (array.indexOf) return array.indexOf(obj); | |
for ( var i = 0; i < array.length; i++) { | |
if (obj === array[i]) return i; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :testdb do | |
# The following task releases task fixes the issue where a database | |
# can't be dropped because it is already been used by another process | |
# e.g. There are 1 other session(s) using the database. : DROP DATABASE IF EXISTS "test_db" | |
# This task removes the process locks from the database that blocks the db from being dropped | |
# @author : FH | |
# @mod version of : http://stackoverflow.com/questions/17615574/cucumber-and-rspec-testing-with-zeus-postgres-is-being-accessed-by-other-users/17746382#17746382 | |
desc 'Simple script to release the database lock and drop the environment database' | |
task :drop do |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Default Value Filter | |
// --------------------- | |
// This filter takes a default value and input to that value it it's null | |
// i.e. {{ github.id | default:'N/A' }} > returns 'N/A' if null otherwise return the id | |
angular.module('default', []).filter('default', function () { | |
return function(input, defaultVal) { | |
if(angular.isUndefined(input) || input === null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/perl | |
use strict; | |
use warnings; | |
my @fgColors = ( | |
'default', 'bold', 'black', 'red', 'blue', 'yellow', 'green', | |
'majenta', 'cyan', 'white', 'bold black', 'bold red', 'bold blue', | |
'bold yellow', 'bold green', 'bold majenta', 'bold cyan', 'bold white'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*jslint browser: true */ | |
/*global $ */ | |
function genString(key, val) { | |
"use strict"; | |
return '"' + key + '",' + '"' + val + '"' + '\r\n'; | |
} | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe('The toggle-summary directive', function() { | |
var elm, $scope, unplannedAbsence, toggleSummary; | |
beforeEach(inject(function($injector) { | |
$httpBackend = $injector.get('$httpBackend'); | |
$httpBackend.whenGET('partials/absenceAccordion.html').respond($window.__html__['src/partials/absenceAccordion.html']); | |
$httpBackend.whenGET('partials/directives/employeeAbsenceList.html').respond($window.__html__['src/partials/directives/employeeAbsenceList.html']); | |
})); | |
var offsetSpy = null; |