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
| { | |
| "version": "2.7.8", | |
| "url": "https://github.com/IronLanguages/ironpython2/releases/download/ipy-2.7.8/IronPython.2.7.8.zip", | |
| "bin": [ | |
| "net45\\ipy.exe", | |
| "net45\\ipy32.exe", | |
| "net45\\ipyc.exe", | |
| "net45\\ipyw.exe", | |
| "net45\\ipyw32.exe" | |
| ] |
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
| [CmdletBinding()] | |
| Param( | |
| [Parameter(ValueFromPipelineByPropertyName)] $FullName, | |
| [string] $description, | |
| [switch] $public, | |
| [switch] $launchBrowser | |
| ) | |
| begin |
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
| def timed_op(fun): | |
| def sync_wrapper(*args, **kwds): | |
| print("Starting", fun.__name__) | |
| start = time.perf_counter() | |
| ret = fun(*args, **kwds) | |
| end = time.perf_counter() | |
| print(fun.__name__, "took", end - start, "({0})".format(ret)) |
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
| @echo off | |
| SETLOCAL | |
| rem https://stackoverflow.com/a/45070967 | |
| goto :init | |
| :header | |
| echo %__NAME% v%__VERSION% | |
| echo This is a sample batch file template, | |
| echo providing command-line arguments and flags. |
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
| template <typename T, typename = std::void_t<>> | |
| struct empty_instance | |
| { | |
| static T get() { return T{}; } | |
| }; | |
| template <typename T> | |
| struct empty_instance<T, std::void_t<decltype(T{ nullptr })>> | |
| { |
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
| # lifted from coreclr | |
| function(add_precompiled_header header cppFile targetSources) | |
| if(MSVC) | |
| set(precompiledBinary "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/stdafx.pch") | |
| set_source_files_properties(${cppFile} | |
| PROPERTIES COMPILE_FLAGS "/Yc\"${header}\" /Fp\"${precompiledBinary}\"" | |
| OBJECT_OUTPUTS "${precompiledBinary}") | |
| set_source_files_properties(${${targetSources}} | |
| PROPERTIES COMPILE_FLAGS "/Yu\"${header}\" /Fp\"${precompiledBinary}\"" |
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
| function Get-DefaultPython { | |
| $pythonVersions = (get-item HKCU:\Software\Python\PythonCore).GetSubKeyNames() | |
| $pythons = $pythonVersions | %{Get-ItemProperty "hkcu:\Software\Python\PythonCore\$_"} | |
| # favor most recent version of Python and x64 version of Python over x86 version | |
| $x64Pythons = $pythons | ?{$_.SysArchitecture.StartsWith("64")} | Sort-Object -Property SysVersion -Descending | |
| if ($x64Pythons.Length -gt 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
| using System; | |
| using System.Diagnostics; | |
| using System.Text; | |
| using System.Threading; | |
| using System.Threading.Tasks; | |
| // https://stackoverflow.com/a/21848564 | |
| public class ConsoleAppManager | |
| { | |
| private readonly string appName; |
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
| function Get-PythonVersions { | |
| (get-item HKCU:\Software\Python\PythonCore).GetSubKeyNames() | |
| } | |
| function Get-DefaultPython { | |
| $pythons = Get-PythonVersions | ForEach-Object{Get-ItemProperty "hkcu:\Software\Python\PythonCore\$_"} | |
| $x64Pythons = $pythons | Where-Object{$_.SysArchitecture.StartsWith("64")} | Sort-Object -Property SysVersion -Descending |
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
| void write_snake_case(writer& w, std::string_view const& name, bool uppercase) | |
| { | |
| auto case_func = [uppercase](char c) | |
| { | |
| return uppercase | |
| ? static_cast<char>(::toupper(c)) | |
| : static_cast<char>(::tolower(c)); | |
| }; |