Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Verschueren SamVerschueren

View GitHub Profile
@SamVerschueren
SamVerschueren / main.js
Created Dec 28, 2017
vscode-languageserver-types
View main.js
/* --------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
* ------------------------------------------------------------------------------------------ */
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
/**
* The Position namespace provides helper functions to work with
* [Position](#Position) literals.
*/
@SamVerschueren
SamVerschueren / ml-completion.provider.ts
Created Dec 14, 2017
Example of a completion provider for ngx-monaco
View ml-completion.provider.ts
import { Injectable } from '@angular/core';
import { CompletionItemProvider } from 'ngx-monaco';
interface PropertyValue {
name: string;
description?: string;
}
interface Property {
name: string;
@SamVerschueren
SamVerschueren / license.js
Last active Jun 27, 2017
transformation function
View license.js
'use strict';
const transform = pkg => {
pkg.license = 'MIT';
return pkg;
};
exports.transformations = [
{
transform,
View index.js
module.exports = (message, queueName, options) => {
options = Object.assign({
awsAccountId: process.env.AWS_ACCOUNT_ID
}, options);
if (!message) {
return Promise.reject(new TypeError('Please provide a message'));
}
// All the rest
View index.es6.js
class FooError extends Error {
constructor(message) {
super(message);
}
}
console.log(FooError.name);
View concat.d.ts
declare module "concat";
@SamVerschueren
SamVerschueren / index.ts
Created Aug 25, 2016
concat wrong example
View index.ts
import * as concat from 'concat';
console.log(concat('foo', 5));
View index.ts
import * as concat from 'concat';
console.log(concat('foo', 'bar'));
View concat.d.ts
declare module "concat" {
function concat(a: string, b: string): string;
export = concat;
}
View index.ts
import * as objectAssign from 'object-assign';
const foo = {
foo: 'bar'
};
const unicorn = objectAssign({
unicorn: 'rainbow'
}, foo);
You can’t perform that action at this time.