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
// Define the decorator | |
// if the method parameter is not passed | |
// then the decorator will return the result of someOtherFunction() | |
// as value for the parameter | |
export const decoratorFunction = (index: number) => ( | |
target: any, | |
key: string, | |
propDesc: PropertyDescriptor | |
) => { | |
let originalFunction: Function = propDesc.value; |
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
for /r %%i in (*.txt) do echo %%i |
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
rmdir /S /Q c:\temp |
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
private void CreateTask(string user) | |
{ | |
QMSClient Client; | |
string QMS = "http://localhost:4799/QMS/Service"; | |
Client = new QMSClient("BasicHttpBinding_IQMS", QMS); | |
string key = Client.GetTimeLimitedServiceKey(); | |
ServiceKeyClientMessageInspector.ServiceKey = key; | |
Client.ClearQVSCache(QVSCacheObjects.UserDocumentList); |
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
// add reference to System.DirectoryServices.AccountManagement | |
// using System.DirectoryServices.AccountManagement; | |
PrincipalContext ctx = new PrincipalContext(ContextType.Domain); | |
GroupPrincipal group = GroupPrincipal.FindByIdentity(ctx, "domain\\groupname"); | |
var users = group.GetMembers(); | |
if (group != null) | |
{ |
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
Model.update({ }, { $set: { status: 'active' }}, { multi: true }, function(err, numAffected) { | |
console.log(numAffected); | |
}); |
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
User.find({}, 'first last', function (err, usr) { | |
//Got the result, saved a few bytes of code | |
}); |
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
Posts | |
.find({}) | |
.sort({}) | |
.limit(5) | |
.exec(function(err, posts) { | |
console.log(posts) | |
}); |
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
psftp username@sftp.server.com -pw password -b commands.txt | |
commands.txt contain all the psft commands that need to be executed like: | |
lcd c:\test | |
mget *.gz |
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
// Save QV table without the headers (or at least without the original headers) | |
set vNH_SourceTable = Data; // which QV table need to be exported | |
set vNH_OutputFile = C:\Users\adm-s7729841\Desktop\Headerless.csv; //the path to the result csv/txt file | |
Qualify *; | |
Headers: | |
First 1 | |
Load | |
* | |
Resident |