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
----------------------------------------------------------------------- | |
-- Collection of queries that helps in performance tuning | |
--grant permission to user | |
GRANT VIEW SERVER STATE TO [user_name] | |
------------ based on http://msdn.microsoft.com/en-us/magazine/cc135978.aspx | |
---------- Uncover hidden data to optimize application performance ----------------------- | |
-- * Number of missing indexes |
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
$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 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 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 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 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 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 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 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); |
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
//Client side utilities for Selenium tests of ExtJS web applications | |
//requires ExtJS and Underscore libraries | |
//SJTXE - Selenium JavaScript Testing eXtension for ExtJS | |
(function(root, Ext) { | |
var root = root || window; | |
var me = root; | |
var Ext = Ext; | |
//private vars | |
var hasJSError = false; | |
NewerOlder