Skip to content

Instantly share code, notes, and snippets.

View gregturn's full-sized avatar

Greg L. Turnquist gregturn

View GitHub Profile
#!/bin/bash
spring run -q `dirname $0`/bootconsole.groovy

Keybase proof

I hereby claim:

  • I am gregturn on github.
  • I am gregturn (https://keybase.io/gregturn) on keybase.
  • I have a public key whose fingerprint is 1DA5 F055 5D51 00BD D2D3 02B2 CB2F A4D5 12B5 C413

To claim this, I am signing this object:

@gregturn
gregturn / gist:403b5e34e2dce9de1d19
Created January 7, 2015 17:19
cujo rest DELETE
rest({method: 'DELETE', path: item._links.gallery.href})
.done(function() {
findLinkedItem(item).remove();
$('#images ul').append(createItemRow(item));
});
@gregturn
gregturn / build.gradle
Created April 8, 2015 17:57
CSS and SASS inside gradle
import org.apache.tools.ant.taskdefs.condition.Os
apply plugin: 'java'
apply plugin: 'com.github.robfletcher.compass'
jar {
from 'dist'
eachFile { details ->
details.path = details.path.startsWith('META-INF') ?: 'static/'+details.path
}
render: function () {
var employees = this.props.employees.map(employee =>
client({method: 'GET', path: employee._links.self.href}).then(response =>
<Employee key={response.entity._links.self.href}
headers={response.headers}
employee={response.entity}
attributes={this.props.attributes}
onUpdate={this.props.onUpdate}
onDelete={this.props.onDelete}/>
)
render: function () {
var employees = this.props.employees.map(employee =>
<Employee key={employee._links.self.href}
headers={response.headers}
employee={response.entity}
attributes={this.props.attributes}
onUpdate={this.props.onUpdate}
onDelete={this.props.onDelete}/>
)
);
@gregturn
gregturn / images.jsx
Created September 1, 2015 18:00
Chunk I want to background
componentDidMount: function () {
this.loadItemsFromServer();
this.loadGalleriesFromServer();
// I want to background this --v
stompClient.register([
{route: '/topic/backend.newItem', callback: this.addItemToUnlinkedList},
{route: '/topic/backend.deleteItem', callback: this.removeItemFromUnlinkedList},
{route: '/topic/backend.removeItemFromGallery-item', callback: this.addItemToUnlinkedList},
{route: '/topic/backend.removeItemFromGallery-gallery', callback: this.updateGallery},
{route: '/topic/backend.addItemToGallery-item', callback: this.removeItemFromUnlinkedList},
$ cd src/main/resources/static/
$ webpack --watch
Hash: f4dea451d9376e16ab27
Version: webpack 1.12.2
Time: 1954ms
Asset Size Chunks Chunk Names
./bundle.js 105 kB 0 [emitted] main
./bundle.js.map 170 kB 0 [emitted] main
[1] when (bower component) 38 bytes {0} [built]
[24] rest (bower component) 43 bytes {0} [built]
@gregturn
gregturn / CloudFoundryDeployHandler.groovy
Created October 19, 2015 16:07
What is REALLY takes to feed authorization through Groovy.
URL url = path.toURL()
URLConnection urlConnection = url.openConnection()
if (url.userInfo != null) {
urlConnection.setRequestProperty(HttpHeaders.AUTHORIZATION, "Basic ${new Base64().encode(url.userInfo.bytes)}")
}
client.uploadApplication(description.application, description.targetPackage.package, urlConnection.inputStream)
@gregturn
gregturn / CloudFoundryDeployHandlerUnitSpec.groovy
Created January 4, 2016 22:25
Mocking jets3t's S3Service generate java.lang.SecurityException
class CloudFoundryDeployHandlerUnitSpec extends Specification {
S3Service s3
S3ServiceFactory s3ServiceFactory
def setup() {
s3 = Mock(S3Service) <--- offending line
s3ServiceFactory = Stub(S3ServiceFactory) {
createS3Service(_) >> { s3 }