I hereby claim:
- I am staticnull on github.
- I am staticnull (https://keybase.io/staticnull) on keybase.
- I have a public key whose fingerprint is 3922 6BC1 6590 60F6 7A32 CD98 BE1C 8F3F 818F E24D
To claim this, I am signing this object:
import grails.util.* | |
class Env { | |
static String getEnvironmentName() { Environment.getCurrent().getName() } | |
static boolean isDevelopment() { GrailsUtil.isDevelopmentEnv() } | |
static boolean isDevelopmentOrTest() { isDevelopment() || isTest() } | |
static boolean isNotDevelopmentOrTest() { !isDevelopmentOrTest() } |
# Git completion | |
if [ -f ~/.git-completion.bash ]; then | |
. ~/.git-completion.bash | |
fi | |
# Git | |
alias gco='git checkout' | |
alias status='git status' | |
alias stat='git status' | |
alias pop='git stash pop' |
I hereby claim:
To claim this, I am signing this object:
<!-- On an HTML page before the report --> | |
<button class="btn btn-success" ng-click="generateReport()"><span class="fa fa-file-pdf-o"></span> Generate Report</button> | |
<!-- demo.coffee --> | |
'use strict' | |
angular.module('demo').controller 'DemoCtrl', ($scope, $stateParams, $state, $q, $window, ReportService, profile, evaluation, group) -> | |
... | |
# Report | |
$scope.generateReport = () -> |
var page = require('webpage').create(), | |
system = require('system'), | |
address, output, size; | |
if (system.args.length < 3 || system.args.length > 5) { | |
console.log('Usage: rasterizestdout.js URL footerImageURL filename [paperwidth*paperheight|paperformat] [zoom]'); | |
console.log(' paper (pdf output) examples: "5in*7.5in", "10cm*20cm", "A4", "Letter"'); | |
phantom.exit(1); | |
} else { | |
address = system.args[1]; |
environments { | |
development { | |
grails.logging.jul.usebridge = true | |
grails.phantomPDFScript = "ui/app/scripts/phantomjs/rasterizestdout.js" | |
grails.serverURL = "http://localhost:8080/demo" | |
} | |
devserver { | |
grails.logging.jul.usebridge = false | |
grails.phantomPDFScript = "/opt/tomcat/webapps/first-step/scripts/phantomjs/rasterizestdout.js" | |
grails.serverURL = "http://surlylabs.com:8080/demo" |
package demo | |
class ReportController { | |
/** | |
* Generate PDF report | |
* | |
* phantomjs ./scripts/phantomjs/rasterizestdout.js <url of report> <name>.pdf <url of footer> | |
* | |
* http://stackoverflow.com/questions/12403817/phantomjs-pipe-input/17286691#17286691 | |
* Need this link in rasterize.js: |
import org.codehaus.groovy.grails.test.junit4.JUnit4GrailsTestType | |
import org.codehaus.groovy.grails.test.support.GrailsTestMode | |
// http://ldaley.com/post/615966534/custom-grails-test | |
def cassandraTestTypeName = "cassandra" | |
def cassandraOrmTestTypeName = "cassandraOrm" | |
def testMode = new GrailsTestMode(autowire: true, wrapInTransaction: true, wrapInRequestEnvironment: true) | |
// 1. Add the name of your phase to this variable with this event handler | |
eventAllTestsStart = { |