How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • import { Directive, HostBinding, HostListener } from '@angular/core';
    
    @Directive({
      selector: '[tohValidator]'
    })
    export class ValidatorDirective {
      @HostBinding('attr.role') role = 'button';
      @HostListener('mouseenter') onMouseEnter() {
        // do work
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">interface</span> <span class="token class-name">Directive</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> Directive<span class="token operator">:</span> DirectiveDecorator <span class="token keyword">import</span> Directive</code><div class="typing-tooltip-markup">Directive decorator and metadata. Type of the Directive metadata.<br><br><em>@Annotation</em><br><br><em>@publicApi</em><br><br><em>@publicApi</em></div></pre>
    Docs
    0
  • import { Directive, HostBinding, HostListener } from '@angular/core';
    
    @Directive({
      selector: '[tohValidator]'
    })
    export class ValidatorDirective {
      @HostBinding('attr.role') role = 'button';
      @HostListener('mouseenter') onMouseEnter() {
        // do work
      }
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">interface</span> <span class="token class-name">Directive</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> Directive<span class="token operator">:</span> DirectiveDecorator <span class="token keyword">import</span> Directive</code><div class="typing-tooltip-markup">Directive decorator and metadata. Type of the Directive metadata.<br><br><em>@Annotation</em><br><br><em>@publicApi</em><br><br><em>@publicApi</em></div></pre>
    Docs
    0
  • import * as path from 'path';
    import { workspace, ExtensionContext } from 'vscode';
    
    import {
      LanguageClient,
      LanguageClientOptions,
      ServerOptions,
      TransportKind
    } from 'vscode-languageclient/node';
    
    let client: LanguageClient;
    
    export function activate(context: ExtensionContext) {
      // The server is implemented in node
      let serverModule = context.asAbsolutePath(path.join('server', 'out', 'server.js'));
      // The debug options for the server
      // --inspect=6009: runs the server in Node's Inspector mode so VS Code can attach to the server for debugging
      let debugOptions = { execArgv: ['--nolazy', '--inspect=6009'] };
    
      // If the extension is launched in debug mode then the debug server options are used
      // Otherwise the run options are used
      let serverOptions: ServerOptions = {
        run: { module: serverModule, transport: TransportKind.ipc },
        debug: {
          module: serverModule,
          transport: TransportKind.ipc,
          options: debugOptions
        }
      };
    
      // Options to control the language client
      let clientOptions: LanguageClientOptions = {
        // Register the server for plain text documents
        documentSelector: [{ scheme: 'file', language: 'plaintext' }],
        synchronize: {
          // Notify the server about file changes to '.clientrc files contained in the workspace
          fileEvents: workspace.createFileSystemWatcher('**/.clientrc')
        }
      };
    
      // Create the language client and start the client.
      client = new LanguageClient(
        'languageServerExample',
        'Language Server Example',
        serverOptions,
        clientOptions
      );
    
      // Start the client. This will also launch the server
      client.start();
    }
    
    export function deactivate(): Thenable<void> | undefined {
      if (!client) {
        return undefined;
      }
      return client.stop();
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">namespace</span> <span class="token function">path</span> <span class="token punctuation">(</span>alias<span class="token punctuation">)</span> <span class="token keyword">const</span> path<span class="token operator">:</span> PlatformPath <span class="token keyword">import</span> path</code></pre>
    Docs
    0
  • async function discoverAllFilesInWorkspace() {
      if (!vscode.workspace.workspaceFolders) {
        return []; // handle the case of no open folders
      }
    
      return Promise.all(
        vscode.workspace.workspaceFolders.map(async workspaceFolder => {
          const pattern = new vscode.RelativePattern(workspaceFolder, '**/*.md');
          const watcher = vscode.workspace.createFileSystemWatcher(pattern);
    
          // When files are created, make sure there's a corresponding "file" node in the tree
          watcher.onDidCreate(uri => getOrCreateFile(uri));
          // When files change, re-parse them. Note that you could optimize this so
          // that you only re-parse children that have been resolved in the past.
          watcher.onDidChange(uri => parseTestsInFileContents(getOrCreateFile(uri)));
          // And, finally, delete TestItems for removed files. This is simple, since
          // we use the URI as the TestItem's ID.
          watcher.onDidDelete(uri => controller.items.delete(uri.toString()));
    
          for (const file of await vscode.workspace.findFiles(pattern)) {
            getOrCreateFile(file);
          }
    
          return watcher;
        })
      );
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">discoverAllFilesInWorkspace</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">Promise</span><span class="token operator">&lt;</span>vscode<span class="token punctuation">.</span>FileSystemWatcher<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">></span></code></pre>
    Docs
    0
  • async function discoverAllFilesInWorkspace() {
      if (!vscode.workspace.workspaceFolders) {
        return []; // handle the case of no open folders
      }
    
      return Promise.all(
        vscode.workspace.workspaceFolders.map(async workspaceFolder => {
          const pattern = new vscode.RelativePattern(workspaceFolder, '**/*.md');
          const watcher = vscode.workspace.createFileSystemWatcher(pattern);
    
          // When files are created, make sure there's a corresponding "file" node in the tree
          watcher.onDidCreate(uri => getOrCreateFile(uri));
          // When files change, re-parse them. Note that you could optimize this so
          // that you only re-parse children that have been resolved in the past.
          watcher.onDidChange(uri => parseTestsInFileContents(getOrCreateFile(uri)));
          // And, finally, delete TestItems for removed files. This is simple, since
          // we use the URI as the TestItem's ID.
          watcher.onDidDelete(uri => controller.items.delete(uri.toString()));
    
          for (const file of await vscode.workspace.findFiles(pattern)) {
            getOrCreateFile(file);
          }
    
          return watcher;
        })
      );
    }
    <pre class="typing-tooltip"><code data-language="javascript" class="language-javascript"><span class="token keyword">function</span> <span class="token function">discoverAllFilesInWorkspace</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token operator">:</span> <span class="token builtin">Promise</span><span class="token operator">&lt;</span>vscode<span class="token punctuation">.</span>FileSystemWatcher<span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token operator">></span></code></pre>
    Docs
    0
  • // The code below shows an example of how to instantiate this type.
    // The values are placeholders you should change.
    import * as workspaces from '@aws-cdk/aws-workspaces';
    
    const cfnWorkspace = new workspaces.CfnWorkspace(this, 'MyCfnWorkspace', {
      bundleId: 'bundleId',
      directoryId: 'directoryId',
      userName: 'userName',
    
      // the properties below are optional
      rootVolumeEncryptionEnabled: false,
      tags: [{
        key: 'key',
        value: 'value',
      }],
      userVolumeEncryptionEnabled: false,
      volumeEncryptionKey: 'volumeEncryptionKey',
      workspaceProperties: {
        computeTypeName: 'computeTypeName',
        rootVolumeSizeGib: 123,
        runningMode: 'runningMode',
        runningModeAutoStopTimeoutInMinutes: 123,
        userVolumeSizeGib: 123,
      },
    });
    
    Docs
    0
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples