Skip to content

Instantly share code, notes, and snippets.

var webdriver = require('selenium-webdriver');
var printPage = function () {
return browser.getPageSource();
};
var logPage = function (txt) {
console.log(txt);
};
@techieBrandon
techieBrandon / gist:f082e9a1c7dc20b83884
Created October 21, 2015 20:40
Grunt scripts:exist task
grunt.registerTask('scripts:exist',function(){
var filesList = grunt.template.process('<%= build.dist.js.dest %>').split(',');
// console.log(filesList);
var done = this.async();
var interval;
var validate = function(){
var missedFiles = [];
@techieBrandon
techieBrandon / gist:3c17748ec5bfb62658fc
Created September 9, 2015 19:59
Publish archive to artifactory via shell
Publish_Web_Archive() {
localFilePath="$1"
targetFolder="http://artifax:8081/artifactory/internal/$2"
artifactoryUser="arieso"
artifactoryPassword="Network123!"
if [ ! -f "$localFilePath" ]; then
echo "ERROR: local file $localFilePath does not exists!"
exit 1
fi
@techieBrandon
techieBrandon / gist:57c5c6df9495dd3c09c6
Created September 9, 2015 19:58
Read in properties file in shell as env variables
Read_Artifactory_Properties () {
ARTIFACTORY_PROPERTIES_FILE=./Build/artifax.credentials
if [[ ! -f $ARTIFACTORY_PROPERTIES_FILE ]]; then
echo "Artifactory credentials file could not be found."
exit 1
fi
while IFS='=' read -r key value; do
[[ -n $key ]] && printf -v ${key//./_} "${value%% }"
@techieBrandon
techieBrandon / AngularJS-Lazy-Bootstrap-Example.markdown
Created February 5, 2015 07:13
AngularJS Lazy Bootstrap Example

AngularJS Lazy Bootstrap Example

This example shows how to use AngularJS modules to load restful configurations prior to main application bootstrap and sharing a resource across initializer and main application.

A Pen by Brandon Wilburn on CodePen.

License.

@techieBrandon
techieBrandon / gist:8403899
Created January 13, 2014 17:06
Timeout to temp resolve race condition for spec file loading on jasmine-requirejs.html
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Jasmine Spec Runner</title>
<% css.forEach(function(style){ %>
<link rel="stylesheet" type="text/css" href="<%= style %>">
<% }) %>
@techieBrandon
techieBrandon / gist:6190945
Created August 9, 2013 03:25
Working solution for local dev CI issue
tr-tz-mbp-2:guiMbb brandonwilburn$ cat Gruntfile.coffee
module.exports = (grunt) ->
path = require('path')
gruntConfig =
pkg: grunt.file.readJSON('package.json')
exec:
generateAppResourcesJson:
@techieBrandon
techieBrandon / gist:6190878
Created August 9, 2013 03:04
Local dev CI problem focus
techieBrandon$ cat Gruntfile.coffee
module.exports = (grunt) ->
path = require('path')
gruntConfig =
pkg: grunt.file.readJSON('package.json')
exec:
generateAppResourcesJson:
@techieBrandon
techieBrandon / gist:6190647
Created August 9, 2013 02:16
local dev CI
techieBrandon$ cat Gruntfile.coffee
module.exports = (grunt) ->
path = require('path')
coffeeFiles =
'web-app/cs/**/*.coffee': { expand: true, flatten: false, cwd: 'web-app/cs/', src: ['**/*.coffee'], dest: '.grunt/web-app/js/', ext: '.js' }
'web-app/coffeeConfig/**/*.coffee': { expand: true, flatten: false, cwd: 'web-app/coffeeConfig/', src: ['**/*.coffee'], dest: '.grunt/web-app/coffeeConfig/', ext: '.js' }
'spec/cs/**/*.coffee': { expand: true, flatten: false, cwd: 'spec/cs/', src: ['**/*.coffee'], dest: '.grunt/spec/js/', ext: '.js' }
@techieBrandon
techieBrandon / gist:5587313
Created May 15, 2013 20:57
Spit out all resources and how they are being processed for Grails
def pull = ctx.getBean('grailsResourceProcessor')
def userDir = System.properties['user.home']
def outFile = new File("${userDir}/resource.out")
outFile.withPrintWriter { wr->
wr.print(pull.dumpResources())
}