Skip to content

Instantly share code, notes, and snippets.

@kkoziarski
Last active December 27, 2022 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kkoziarski/a52091e8a72a638d53d3efacaf340425 to your computer and use it in GitHub Desktop.
Save kkoziarski/a52091e8a72a638d53d3efacaf340425 to your computer and use it in GitHub Desktop.
Polyglot Notebook (.NET Interactive notebooks) - setup
###############################################################################
# Set default behavior to automatically normalize line endings.
###############################################################################
* text=auto
# Never modify line endings of dib files
*.dib text eol=lf
{
"folders": [
{
"path": "."
}
],
"settings": {
"omnisharp.enableAsyncCompletion": true,
"omnisharp.useModernNet": true,
"interactiveWindow.collapseCellInputCode": "always",
"notebook.showFoldingControls": "always",
"notebook.cellToolbarVisibility": "hover",
"notebook.cellFocusIndicator": "border",
"notebook.diff.ignoreMetadata": false,
"notebook.diff.ignoreOutputs": true,
"notebook.dragAndDropEnabled": false,
"notebook.lineNumbers": "on",
"notebook.outline.showCodeCells": true,
"notebook.diff.enablePreview": false,
"notebook.consolidatedOutputButton": false,
"notebook.compactView": false,
"notebook.output.textLineLimit": 50,
"vsicons.associations.files": [
{ "icon": "pddl_happenings", "extensions": ["dib"], "format": "svg" }
],
"files.exclude": {
"**/.gitattributes": true,
"**/.gitignore": true,
"**/*.code-workspace": true
}
},
"extensions": {
"recommendations": [
"vscode-icons-team.vscode-icons",
"ms-dotnettools.dotnet-interactive-vscode",
]
}
}
#!meta
{"kernelInfo":{"defaultKernelName":null,"items":[{"name":"csharp","languageName":"C#","aliases":["c#","cs"]},{"name":"fsharp","languageName":"F#","aliases":["f#","fs"]},{"name":"pwsh","languageName":"PowerShell","aliases":["powershell"]},{"name":"javascript","languageName":"JavaScript","aliases":["js"]},{"name":"html","languageName":"HTML"},{"name":"sql","languageName":"SQL"},{"name":"kql","languageName":"KQL"},{"name":"mermaid","languageName":"Mermaid"},{"name":"httpRequest","languageName":"http"},{"name":"value"}]}}
#!csharp
$"Hello world at {DateTime.Now}".Display();
#!csharp
string name = "Krzysztof Koziarski";
int age = 5;
public class Helper {
public static void Print(string text) => Console.WriteLine(text);
}
#!csharp
"Using values from previous cell".Display();
Helper.Print($"I'm {name} and {age} years old");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment