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
// This sample will guide you through elements of the F# language. | |
// | |
// ******************************************************************************************************* | |
// To execute the code in F# Interactive, highlight a section of code and press Alt-Enter or right-click | |
// and select "Execute in Interactive". You can open the F# Interactive Window from the "View" menu. | |
// ******************************************************************************************************* | |
// | |
// For more about F#, see: | |
// http://fsharp.org | |
// https://docs.microsoft.com/en-us/dotnet/articles/fsharp/ |
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
<?xml version="1.0" encoding="utf-8"?> | |
<key name="Software"> | |
<key name="ConEmu"> | |
<key name=".Vanilla" modified="2019-04-03 09:47:48" build="190331"> | |
<value name="Language" type="string" data="en"/> | |
<value name="StartType" type="hex" data="02"/> | |
<value name="CmdLine" type="string" data=""/> | |
<value name="StartTasksFile" type="string" data=""/> | |
<value name="StartTasksName" type="string" data="{Shells::PowerShell Core (Admin)}"/> | |
<value name="StartFarFolders" type="hex" data="00"/> |
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
{ | |
"manifestVersion": 1, | |
"id": "my-first-extension", | |
"publisher": "AryanEbrahimpour", | |
"version": "1.1.3", | |
"name": "My First Extension", | |
"description": "A sample Visual Studio Services extension", | |
"public": false, | |
"categories": ["Azure Repos"], | |
"targets": [ |
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 findSpecialMinMax arr = | |
let rec f arr bestMin bestMax currentMin currentMax = | |
match arr with | |
| [] -> (bestMin, bestMax) | |
| cur::rest -> | |
match (bestMin, bestMax) with | |
| None, _ -> f rest (Some cur) None None None | |
| Some min, None -> | |
if cur > min then f rest (Some min) (Some cur) None None | |
else f rest (Some cur) None None None |
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
const std = @import("std"); | |
fn printaddr(a : anytype) void { | |
const stdout = std.io.getStdOut().writer(); | |
stdout.print("address = {s}\n", .{&a}) catch unreachable; | |
} | |
fn foo() void { | |
const s1 = "literal"; |
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 getRating n = | |
let (*) = String.replicate | |
(n * "🌕") + ((5 - n) * "🌑") | |
getRating 5 |> System.Console.WriteLine |
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
const isShadowRoot = (maybeRoot) => { | |
return maybeRoot && maybeRoot.toString() === '[object ShadowRoot]' | |
} | |
const closestPastShadowDom = (elem, selector) => { | |
const closest = elem.closest(selector); | |
if(closest) | |
return closest; | |
const root = elem.getRootNode(); |
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 System | |
open System.Linq | |
open System.Diagnostics | |
// change cpu affinity while app is running | |
// run in debug mode: optimizations off | |
printfn "Press enter to continue" |
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
const getDragonBit = (n) => { | |
while ((n & 1) == 0) { | |
n = n >> 1; | |
} | |
return 1 - ((n >> 1) & 1) | |
} | |
const getDragon = n => { | |
let str = "" | |
for (i = 1; i < Math.pow(2, n); i++) { |
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
const getDragon2 = n => { | |
const getDragonRecurse = (n, complement) => { | |
if(n === 1) { | |
return complement ? [0] : [1] | |
} | |
const right = getDragonRecurse(n - 1, complement); | |
const left = getDragonRecurse(n - 1, !complement); | |
return complement ? [...right, 0, ...left] : [...left, 1, ...right] | |
} |
OlderNewer