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
this.map.addListener('click', | |
// Lambdas to the rescue, it will automatically capture this | |
(e: google.maps.MouseEvent) => { | |
// Run event handler in Angular Zone, so that change detection will work | |
this._ngZone.run(() => | |
this.mapClick.emit(e.latLng)); | |
}); |
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
<google-map | |
[center]='center' | |
[zoom]='zoom' | |
(mapClick)='onMapClick($event)' | |
[markers]='markers' | |
[heatmapData]='heatmapData'> | |
</google-map> |
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
constructor(private _renderer: Renderer) { } |
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
<cfscript> | |
private struct function test() { | |
if(1 == 1) { | |
if(1 == 0) { | |
writeOutput("1==0"); | |
}; | |
writeOutput("true"); | |
return {data = 1}; | |
} | |
writeOutput("false"); |
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
$nDays = 30 | |
$path = "C:\temp" | |
$threshold = (Get-Date).AddDays(-$nDays) | |
Get-ChildItem -Path $path -Recurse | Where-Object { | |
-not $_.PSIsContainer -and $_.LastWriteTime -lt $threshold | |
} | Remove-Item -Force |
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
<cfscript> | |
//list all the JDBC drivers for diagnosis purpose | |
factory = createObject("java","coldfusion.server.ServiceFactory"); | |
writeDump(factory.dataSourceService.getDrivers()); | |
fileName = "d:/temp/temp.mdb"; | |
classLoader = createObject("java","java.lang.Class"); | |
driver = classLoader.forName("sun.jdbc.odbc.JdbcOdbcDriver"); | |
//connect to MDB using 64-bit java and 64-bit MS Access Driver | |
connStr = "jdbc:odbc:Driver={Microsoft Access Driver (*.mdb, *.accdb)};DBQ=" & fileName; |
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
//handles ExtJS grid select event | |
//grid should have selType = 'cellmodel' | |
onGridSelect: function(sel, rec, row, col, opts) { | |
var selection = sel.nextSelection; | |
var dataIndex = selection.view.getGridColumns()[col].dataIndex; | |
var data = rec.get(dataIndex); | |
//...your event handler code here | |
} |
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
{ | |
xtype: 'image', | |
src: 'icons/google.png', | |
//defines the element that wraps around the image | |
autoEl: { | |
tag: 'a', | |
href: 'http://www.google.com', | |
target: '_blank' | |
//add any other attributes to the 'a' tag as needed | |
} |
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
String gridQuery = "viewport #grid1"; | |
String js = "return Ext.ComponentQuery.query('" + gridQuery | |
+ "')[0].getSelectionModel().getSelection()[0].data"; | |
@SuppressWarnings(value="unchecked") | |
Map<String, Object> row = (Map<String, Object>)((JavascriptExecutor) _driver).executeScript(js); | |
assertThat("Project name", row.get("ProjectName").toString(), equalTo("Expected Project Name")); |
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
// ask IE to ignore zoom level, otherwise IE may have problem starting | |
DesiredCapabilities caps = DesiredCapabilities | |
.internetExplorer(); | |
caps.setCapability("ignoreZoomSetting", true); | |
driver = new InternetExplorerDriver(caps); |
NewerOlder