This file contains hidden or 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
| [Authorize(Policy = "AtLeast21")] | |
| public class AtLeast21Controller : Controller | |
| { | |
| public IActionResult Index() => View(); | |
| } |
This file contains hidden or 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
| " Don't try to be Vi compatible | |
| " Enables Vim features, which are not compatible with Vi | |
| set nocompatible | |
| " Setup autoreload of config when it's saved | |
| autocmd! BufWritePost $MYVIMRC ++nested source <afile> | |
| autocmd! SourcePost $MYVIMRC ++nested call LightlineReload() | |
| " Source custom wrapper around Vim Plug | |
| " It automatically downloads and installs it on 1st usage |
This file contains hidden or 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
| -- Setup bootstrap of vim-plug | |
| local vimplug_install_path = vim.fn.stdpath('config') .. '/autoload/plug.vim' | |
| local vimplug_github_url = 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' | |
| if vim.fn.filereadable(vim.fn.expand(vimplug_install_path)) == 0 then | |
| vim.fn.execute('!curl -fLo ' .. vimplug_install_path .. ' --create-dirs ' .. vimplug_github_url) | |
| end | |
| -- Setup sourcing of config file when saved | |
| local packer_group = vim.api.nvim_create_augroup('Config', { clear = true }) |
This file contains hidden or 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
| local Plug = vim.fn['plug#'] | |
| vim.call('plug#begin') | |
| Plug 'dstein64/vim-startuptime' | |
| -- Option 1: control | |
| Plug 'itchyny/lightline.vim' | |
| -- Option 2: lualine |
This file contains hidden or 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
| set encoding=utf-8 | |
| scriptencoding utf-8 | |
| set nocompatible | |
| syntax on | |
| set mouse=a | |
| set laststatus=2 | |
| set wildmenu | |
| set hidden |
This file contains hidden or 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
| set shell=/bin/bash | |
| let s:vimrc_folder = fnamemodify(resolve(expand('<sfile>:p')), ':h') | |
| execute 'source ' . s:vimrc_folder . '/.vimrc-vimplug' | |
| call VimplugBegin(s:vimrc_folder) | |
| """ Color schemes | |
| Plug 'embark-theme/vim', { 'as': 'embark' } | |
| Plug 'artanikin/vim-synthwave84' |
This file contains hidden or 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
| open FsCheck | |
| let swap i j (arr : array<'a>) = | |
| let tmp = arr.[i] | |
| arr.[i] <- arr.[j] | |
| arr.[j] <- tmp | |
| let partition arr = | |
| let pivot = Array.last arr | |
| let mutable runningIndex = 0 |
This file contains hidden or 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
| class DatabaseInfo | |
| { | |
| public LightningEnvironment Environment; | |
| public string Name; | |
| public int Counter; | |
| public DatabaseInfo(LightningEnvironment env, string dbName) | |
| { | |
| Environment = env; | |
| Name = dbName; |
This file contains hidden or 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
| let mod3 x = x%3 = 0 | |
| let mod5 x = x%5 = 0 | |
| let (|Fizz|_|) x = if mod3 x then Some() else None | |
| let (|Buzz|_|) x = if mod5 x then Some() else None | |
| let fizzBuzzOne = | |
| function | |
| | Fizz & Buzz -> "FizzBuzz" | |
| | Fizz -> "Fizz" |
This file contains hidden or 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
| var EventHubClient = require('azure-event-hubs').Client; | |
| var Promise = require('bluebird'); | |
| var connectionString = 'Endpoint=sb://[...].servicebus.windows.net/;SharedAccessKeyName=[...];SharedAccessKey=[...]'; | |
| var eventHubPath = '[...]'; | |
| var errorHandler = (partitionId, err) => console.warn(`==> RX ERROR (${partitionId}): ${err}`); | |
| var messagesCounter = 0; | |
| var messageHandler = (partitionId, msg) => { |
NewerOlder