This file contains hidden or 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
package com.objectpartners.application.config | |
config { | |
social { | |
twitter { | |
consumerKey = "ABCD" | |
consumerSecret = "EFGH" | |
accessToken = "IJKL" | |
accessTokenSecret = "MNOP" | |
} |
This file contains hidden or 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
package com.danveloper.reactor.config | |
reactor { | |
social { | |
twitter { | |
consumerKey = "ABCD" | |
consumerSecret = "EFGH" | |
accessToken = "IJKL" | |
accessTokenSecret = "MNOP" | |
} |
This file contains hidden or 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
public class ImprovedNamingDescriptorCustomizer implements DescriptorCustomizer { | |
@Override | |
public void customize(ClassDescriptor classDescriptor) throws Exception { | |
String className = classDescriptor.getJavaClassName(); | |
String shortName = Helper.getShortClassName(className); | |
String improvedName = toImprovedName(shortName); | |
classDescriptor.setTableName(improvedName); | |
updateMappings(classDescriptor, improvedName); |
This file contains hidden or 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
public class TrampolineLambda { | |
interface TrampolineFunction<T, R> { | |
R apply(T...obj); | |
public default Object trampoline(T...objs) { | |
Object result = apply(objs); | |
if (!(result instanceof TrampolineFunction)) { | |
return result; | |
} else { | |
return this; |
This file contains hidden or 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
public class MemoizedLambdaFib { | |
interface MemoizedFunction<T, R> { | |
enum Cache { | |
_; | |
Map<Object, Object> vals = new HashMap<>(); | |
} | |
R calc(T t); |
This file contains hidden or 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
public class Promises { | |
private static class PageMetrics { | |
Integer visits; | |
Long avgMsOnPage; | |
@Override | |
public String toString() { | |
return String.format("{ avgMsOnPage=%d, visits=%d }", avgMsOnPage, visits); | |
} |
This file contains hidden or 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
#!/bin/sh | |
find . -iname "*.java" -exec sed s/\;$// {} \; |
This file contains hidden or 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
class LoggingService { | |
/** | |
* These two fields represent the atmosphere "config". | |
*/ | |
static final MAPPING_URI = ApplicationHolder.application.config.grails.atmosphere.mappingUri | |
static atmosphere = [mapping: MAPPING_URI] | |
/** | |
* The {@link LoggingServiceActivator} delegates its messages to this method. | |
* This method, in turn, broadcasts them to the UI via the atmosphere broadcaster. |
This file contains hidden or 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
<!-- ... some rendered code, divs and shit, removed for brevity ... --> | |
<script> | |
(function() { | |
var url = '${createLink(uri: ApplicationHolder.application.config.grails.atmosphere.mappingUri)}/logchannel/${id}/${ip}/${hostname}'; | |
$.atmosphere.subscribe(url, Logging.router, $.atmosphere.request = {transport:'websocket', fallbackTransport:'streaming'}); | |
... | |
})(); | |
</script> |
This file contains hidden or 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
<!-- ... resources & jquery snipped for brevity ... --> | |
<atmosphere:resources/> | |
<r:script> | |
$(document).ready(function() { | |
var url = '${createLink(uri:ApplicationHolder.application.config.grails.atmosphere.mappingUri)}'; | |
$.atmosphere.subscribe(url, Logging.router, $.atmosphere.request = {transport:'websocket', fallbackTransport:'streaming'}); | |
... | |
}); | |
</r:script> |