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
dmc -c -DIMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCS=1 -DSIZE_T=size_t -Dsnprintf=_snprintf imgui.cpp imgui_draw.cpp |
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
/** | |
* This module contains a minimal garbage collector implementation according to | |
* published requirements. This library is mostly intended to serve as an | |
* example, but it is usable in applications which do not rely on a garbage | |
* collector to clean up memory (ie. when dynamic array resizing is not used, | |
* and all memory allocated with 'new' is freed deterministically with | |
* 'delete'). | |
* | |
* Please note that block attribute data must be tracked, or at a minimum, the | |
* FINALIZE bit must be tracked for any allocated memory block because calling |
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 Dll_ = core.sys.windows.dll; | |
import W32_ = core.sys.windows.windows; | |
/* -------------------------------------------------------------------------- */ | |
/* --- runtime initialisation --- */ | |
version (CRuntime_DigitalMars) {} else {static assert(0);}; |
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
Array(5) | |
-> [<5 empty slots>] | |
[...Array(5)] | |
-> [undefined, undefined, undefined, undefined, undefined] | |
[...Array(5)].map((_, X) => X) | |
-> [0, 1, 2, 3, 4] | |
[...Array(5).keys()] |
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
(() => { | |
var let = (f) => f(); | |
let a = 2, b = 5; | |
let c = let(( | |
x = a + b, | |
y = x * 2 | |
) => | |
y * 2 |
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
[...Array(256).keys()] | |
.map(X => String.fromCharCode(X)) | |
.filter(X => !/\s/.test(X)) | |
.filter(X => { | |
try { | |
eval(`() => {let _${X} = 0;}`); | |
} catch (Err) { | |
return false; | |
}; | |
return true; |
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
# comments | |
<# multiline comments #> | |
# running unsigned scripts | |
c:\> powershell -ExecutionPolicy Bypass -File foo.ps1 | |
# filter, map | |
get-process | | |
where {$_.ProcessName -eq "svchost"} | | |
foreach {$_.Id} |
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
# ------------------------------------------------------------------------------ | |
# loads libcurl.dll and calls curl_version() | |
# | |
set-strictmode -version 'latest' | |
$erroractionpreference = 'Stop' | |
#if ([intptr]::size -ne 8) { | |
# throw 'not a 64-bit powershell instance'} | |
$w32 = Add-Type -Namespace Win32 -Name Win32 -PassThru -MemberDefinition @' |
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
using System.Linq; | |
class Foo { | |
static void Main(string[] _) { | |
var xs = new[] {"apple", "passionfruit", "banana", "mango", "pear",}; | |
/* https://msdn.microsoft.com/en-us/library/9eekhta0 */ | |
var ys = xs |
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
# ------------------------------------------------------------------------------ | |
# Leopard Systems ? (2017) | |
# contributors: Adam Laing | |
# note: requires powershell 2.0 or later | |
set-strictmode -version 'latest' | |
$erroractionpreference = 'stop' |