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
<# | |
.DESCRIPTION | |
Outputs the SSL protocols that the client is able to successfully use to connect to a server. | |
.PARAMETER ComputerName | |
The name of the remote computer to connect to. | |
.PARAMETER Port | |
The remote port to connect to. The default is 443. |
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
const path = require("path"); | |
const fs = require("fs"); | |
const getChildOf = (s) => new Promise(resolve => { | |
return fs.readdir(s, (e, children) => resolve(children.map(c => `${s}${path.sep}${c}`))); | |
}); | |
const isDirectory = path => fs.lstatSync(path).isDirectory(); | |
const cleanup = async (path) => { | |
const children = await getChildOf(path); |
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
import * as vscode from 'vscode'; | |
// Runs when extension is activated (very first time the command is executed) | |
export function activate(context: vscode.ExtensionContext) { | |
console.log('Congratulations, your extension "helloworld" is now active!'); | |
// Create handler for command defined in package.json file | |
const disposable = vscode.commands.registerCommand('extension.helloWorld', () => { | |
// Runs every single time comand is executed |
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
main: "./out/extension.js", | |
activationEvents: [ | |
"onCommand:extension.helloWorld" | |
], | |
contributes: { | |
commands: [{ | |
"command": "extension.helloWorld", | |
"title": "Hello World" | |
}] | |
} |
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
// Display a message box to the user | |
vscode.window.showInformationMessage( | |
'Hello World!', | |
"Options 1 - Say back hello", | |
"Options 2 - Ignore the hello", | |
"Options 3 - Checkout this option", | |
).then(chosen => { | |
vscode.window.showInformationMessage(`You chose : ${chosen || 'nothing'}`); | |
}); |
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
/** | |
* Show an information message to users. Optionally provide an array of items which will be presented as clickable buttons. | |
* @param message The message to show. | |
* @param items A set of items that will be rendered as actions in the message. | |
* @return A thenable that resolves to the selected item or `undefined` when being dismissed. | |
*/ | |
export function showInformationMessage(message: string, ...items: string[]): Thenable; | |
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
# install yeoman and visual studieo code generator | |
npm install -g yo generator-code | |
# create a new project boilerplate | |
yo code | |
# select a typescript project | |
# select the name as helloworld |
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
new file: .eslintrc.json | |
new file: .gitignore | |
new file: .vscode/extensions.json | |
new file: .vscode/launch.json | |
new file: .vscode/settings.json | |
new file: .vscode/tasks.json | |
new file: .vscodeignore | |
new file: CHANGELOG.md | |
new file: README.md | |
new file: package-lock.json |
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
# Operators | |
############################# | |
# Powershell # Javascript | |
$name = 'Rohit' # var name = 'Rohit' | |
1 -eq 1 # 1 == 1 | |
1 -neq 1 # 1 != 1 | |
1 -gt 2 # 1 >= 2 | |
1 -lt 2 # 1 < 2 | |
1 -le 1 # 1 <= 1 | |
2 -ge 1 # 2 >= 1 |
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
<# | |
JavaScript uses /* comments */ for multiline comments | |
Powershell uses <# comments #> for multiline comments | |
#> | |
# Javascript uses // for single line comment | |
# Powershell uses # for single line comment | |
# JavaScript - writting console log |
NewerOlder