Skip to content

Instantly share code, notes, and snippets.

View kastork's full-sized avatar

Kirk Stork kastork

View GitHub Profile
<portlet:renderURL var="myResourceURL">
<portlet:param name="mvcPath" value="/my_file.jsp" />
<portlet:param name="redirect" value="<%= currentURL %>" />
<portlet:param name="myCustomParam" value="{myCustomParam}" />
</portlet:renderURL>
var resourceURL = A.Lang.sub(
decodeURIComponent('<%= myResourceURL %>'),
{
myCustomParam: myCustomParam
@duncansmart
duncansmart / progressive-ace.htm
Created March 28, 2013 23:29
Integrating ACE Editor in a progressive way
<textarea name="my-xml-editor" data-editor="xml" rows="15"></textarea>
...
<textarea name="my-markdown-editor" data-editor="markdown" rows="15"></textarea>
...
<script src="//d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js"></script>
<script>
// Hook up ACE editor to all textareas with data-editor attribute
$(function () {
@auser
auser / app.js
Last active October 11, 2017 03:01
The complete source for the http://www.ng-newsletter.com/posts/chrome-apps-on-angular.html article. Enjoy!
angular.module('myApp', ['ngRoute'])
.provider('Weather', function() {
var apiKey = "";
this.getUrl = function(type, ext) {
return "http://api.wunderground.com/api/" +
this.apiKey + "/" + type + "/q/" +
ext + '.json';
};
@auser
auser / app.js
Last active January 26, 2021 01:59
angular.module('myApp',
['ngRoute', 'myApp.services', 'myApp.directives']
)
.config(function(AWSServiceProvider) {
AWSServiceProvider.setArn('arn:aws:iam::<ACCOUNT_ID>:role/google-web-role');
})
.config(function(StripeServiceProvider) {
StripeServiceProvider.setPublishableKey('pk_test_YOURKEY');
})
.config(function($routeProvider) {
@skuenzli
skuenzli / heroku_ssl_grails_232.md
Created January 12, 2014 19:03
Configure SSL for a Grails 2.3.2 app hosted on *.herokuapp.com

configure ssl for a grails 2.3.2 app hosted on *.herokuapp.com

This snippet configures proper detection of the http/https channel security by a Grails 2.3.2 application using the (latest) Spring Security 2.0-RC2 grails plugin. This configuration resides-in grails-app/conf/Config.groovy.

// belongs in 'production' environment block or guarded by, e.g. a System.property-check.

// [heroku] proxy support -- allow SSL to be terminated at the load balancer / proxy
// look for X-FORWARDED-PROTO (case-sensitive)
// https://discussion.heroku.com/t/grails-spring-security-core-securechannel-definition-causes-redirect-loop/219/2
@jexp
jexp / _blog_post.adoc
Created October 9, 2014 19:51
neo4j batch import with groovy

How to use the Neo4j Batch-Inserter for your own CSV files

You might have data as CSV files to create nodes and relationships from in your Neo4j Graph Database. It might be a lot of data, like many tens of million lines. Too much for LOAD CSV to handle transactionally.

@bodiam
bodiam / healthcheck.groovy
Created May 25, 2015 20:16
A small script to check the health status of your Grails 3 and Spring Boot applications
#!/usr/bin/env groovy
import groovy.json.JsonSlurper
/**
* Displays the status of registered Spring Boot URL's.
* To register URL's, create a file called healthcheck.txt in the following format
*
* <name>,<url>
*
* Eg: healthcheck.txt:
@mojavelinux
mojavelinux / build.gradle
Last active March 2, 2017 18:00
A Gradle build that generates a versioned PDF for multiple AsciiDoc documents. Separate tasks are used for illustrative purposes and to allow each conversion to be individually configured.
buildscript {
dependencies {
classpath 'org.asciidoctor:asciidoctorj:1.5.4.1'
}
}
plugins {
id 'org.asciidoctor.convert' version '1.5.3'
id 'com.github.jruby-gradle.base' version '1.3.3'
}

Technical details for https://stackoverflow.com/a/44169445/6730571

Details of investigation:

On a base system, /usr/bin/java is a symlink that points to /System/Library/Frameworks/JavaVM.framework/Versions/Current/Commands/java, which is an Apple wrapper tool that locates and executes the actual java.

(Do not touch anything in those 2 system directories. It should actually be impossible due to "System Integrity Protection" anyway.)

If you don't have Java installed, attempting to execute java will open a dialog that invites you to install it.