This file contains 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
/** Allows import of other files e.g. const GitHub=imports.github; = github.js */ | |
imports.searchPath.push(imports.ui.appletManager.appletMeta["github-projects@morgan-design.com"].path); | |
/** Imports START **/ | |
const Mainloop = imports.mainloop; | |
const Lang = imports.lang; | |
const Gettext = imports.gettext.domain('cinnamon-applets'); | |
const _ = Gettext.gettext; | |
const Cinnamon = imports.gi.Cinnamon; | |
const St = imports.gi.St; |
This file contains 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
@Aspect | |
public class LoggingAspect { | |
private ILoggerFactory iLoggerFactory = LoggerFactory.getILoggerFactory(); | |
@Before("execution(@com.morgan.design.demo.annotation.LogMe(com.morgan.design.demo.annotation.LoggingLevel.WARN) * *(..))") | |
public void loggerWarn(final JoinPoint jp) throws Throwable { | |
final Logger logger = getLoggerForClass(jp); | |
logger.warn(buildLogging(jp)); | |
} |
This file contains 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.morgan.design.demo; | |
import org.springframework.stereotype.Component; | |
import com.morgan.design.demo.annotation.LogMe; | |
import com.morgan.design.demo.annotation.LoggingLevel; | |
@Component | |
public class LoggingExample { |
This file contains 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
PushbuttonField barcodeButton = acroFields.getNewPushbuttonFromField("barcode_button"); | |
if(barcodeButton){ | |
// These settings are optional, null can be passed in as the four argument to BarcodeQRCode | |
Map<EncodeHintType, Object> hints = Maps.newHashMap(); | |
hints.put(EncodeHintType.ERROR_CORRECTION, ErrorCorrectionLevel.L); | |
hints.put(EncodeHintType.CHARACTER_SET, "ISO-8859-1"); | |
BarcodeQRCode qrcode = new BarcodeQRCode("SomeBarcodeData_123456789", 0, 0, hints); | |
barcodeButton.setLayout(PushbuttonField.LAYOUT_ICON_ONLY); |
This file contains 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
/** | |
* An expected call to my matcher | |
*/ | |
this.context.checking(new Expectations() { | |
{ | |
one(someMockedService).save(with(args), with(def), with(thisObjectArray(batch))); | |
} | |
}); | |
this.seviceUnderTest.source(args); | |
This file contains 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
String rawSql = new AlterTableBuild() | |
.alterTable(Person.class) | |
.addColumn(Person.FOO_ID) | |
.after(Person.NAME) | |
.migrate() | |
.from("old_column") | |
.to(Person.FOO_ID) | |
.build(); | |
this.db.executeRaw(rawSql); |
This file contains 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
/** | |
* Used as a aid in the migration process for, loading required SQL files as specified by a given version | |
* | |
* @author James Edward Morgan | |
*/ | |
public class UpgradeHelper { | |
private static final String LOG_TAG = "UpgradeHelper"; | |
protected static final Set<Integer> VERSION; |
This file contains 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.morgan.design; | |
public class TODO { | |
private TODO() { | |
} | |
//@formatter:off | |
// //////////////////////// | |
// Build / Configuration // |
This file contains 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 DynamicAssetsLoader { | |
public static function loadImage(image:Image, assetUri:String):void | |
{ | |
// if not | |
if(!assetUri){ | |
image.includeInLayout = false; | |
image.visible = false; | |
image.source = null; | |
return; |
This file contains 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 AdobeReaderPrinting { | |
public static void main(final String[] args) { | |
final File file = new File("src/test/resources/tests/Sample_Printing.pdf"); | |
final Runtime r = Runtime.getRuntime(); | |
Process p = null; | |
try { | |
// Information about command line printing flags can be foud at http://livedocs.adobe.com/acrobat_sdk/10/Acrobat10_HTMLHelp/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Acrobat10_SDK_HTMLHelp&file=DevFAQ_UnderstandingSDK.22.31.html | |
final String printing = | |
"C:\\Program Files (x86)\\Adobe\\Reader 10.0\\Reader\\AcroRd32.exe /s /h /t " + file.getCanonicalPath() |
OlderNewer