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
| -- DROP FUNCTION [dbo].[fn_tenantSecurityPredicate] | |
| CREATE FUNCTION [dbo].[fn_tenantSecurityPredicate](@tenantId UNIQUEIDENTIFIER) | |
| RETURNS TABLE | |
| WITH SCHEMABINDING | |
| AS | |
| RETURN SELECT 1 AS [predicateResult] | |
| FROM [dbo].[Users] | |
| WHERE [Username] = CURRENT_USER | |
| AND ([TenantId] IS NULL OR ([TenantId] IS NOT NULL AND @tenantId = [TenantId])); | |
| GO |
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
| var el = $('#some-element'); | |
| var selector = '#some-elements-parent-further-up-the-dom'; | |
| for ( ; el && el !== document; el = el.parentNode ) { | |
| if ( el.matches( selector ) ) return el; | |
| } |
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
| function waitForElement(selector, time) { | |
| if (document.querySelector(selector) !== null) { | |
| alert("The element is displayed, you can put your code instead of this alert.") | |
| return; | |
| } | |
| else { | |
| setTimeout(function() { | |
| waitForElementToDisplay(selector, time); | |
| }, time); | |
| } |
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
| const generateDownload = report => { | |
| var downloadLink = document.createElement('a'); | |
| downloadLink.style = 'display: none'; | |
| document.body.appendChild(downloadLink); | |
| var blob = new Blob([report.data], { | |
| type: 'application/octet-stream', | |
| }); | |
| var url = window.URL.createObjectURL(blob); |
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
| touch ~/.gitignore_global | |
| git config --global core.excludesfile ~/.gitignore_global |
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 RetryUtility | |
| { | |
| public void Do(Action action, int retryInterval = 100, int maxAttemptCount = 3) | |
| { | |
| Do<object>(() => | |
| { | |
| action(); | |
| return null; | |
| }, retryInterval, maxAttemptCount); | |
| } |
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
| <Query Kind="Program"> | |
| <NuGetReference>Nancy.Hosting.Self</NuGetReference> | |
| <Namespace>Nancy</Namespace> | |
| <Namespace>Nancy.Bootstrapper</Namespace> | |
| <Namespace>Nancy.Conventions</Namespace> | |
| <Namespace>Nancy.Cookies</Namespace> | |
| <Namespace>Nancy.Cryptography</Namespace> | |
| <Namespace>Nancy.Culture</Namespace> | |
| <Namespace>Nancy.Diagnostics</Namespace> | |
| <Namespace>Nancy.Diagnostics.Modules</Namespace> |
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
| <Query Kind="Program"> | |
| <Namespace>System.Diagnostics</Namespace> | |
| <Namespace>System.Runtime.InteropServices</Namespace> | |
| </Query> | |
| void Main() | |
| { | |
| const string fileLocked = @"C:\elasticsearch\kibana-4.2.0-windows\node\node.exe"; | |
| var processes = FileUtil.WhoIsLocking(fileLocked); |
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
| function Add-ElasticWatch-v2($name, $body) { | |
| $uri = "http://localhost:9200/_watcher/watch/" + $name | |
| Add-ElasticWatch($name, $uri, $body) | |
| } | |
| function Add-ElasticWatch-v5($name, $body) { | |
| $uri = "http://localhost:9200/_xpack/watcher/watch/" + $name | |
| Add-ElasticWatch($name, $uri, $body) |
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
| robocopy [From] [TO] /MOVE /S /Z /R:3 |
NewerOlder