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
cd $env:TEMP | |
mkdir testupywrap | |
cd testupywrap | |
git clone https://github.com/stinos/micropython | |
git -C .\micropython\ switch windows-pyd | |
git clone https://github.com/stinos/micropython-wrap | |
msbuild .\micropython\ports\windows\micropythoncore.vcxproj | |
msbuild .\micropython\ports\windows\micropython.vcxproj | |
msbuild .\micropython-wrap\micropython-wrap.vcxproj | |
cd .\micropython\ports\windows\build-tns |
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
//code from https://github.com/sdumetz/coordinates/tree/master/src | |
//original license: https://github.com/sdumetz/coordinates/blob/master/LICENSE | |
#include "Coordinates.h" | |
Coordinates::Coordinates(float x, float y) { | |
fromCartesian(x, y); | |
} | |
void Coordinates::fromCartesian(float x, float y) { |
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
function Install-Msys2 () { | |
param ( | |
[Parameter()] [String] $Dir = 'c:\tools\msys2' | |
) | |
if (Test-Path $Dir -PathType Any) { | |
$reply = Read-Host -Prompt "MSys2 destination $Dir exists. Delete and continue? [y/n]" | |
if ($reply -eq 'y') { | |
Remove-Item -Recurse -Force $Dir | |
} else { | |
return |
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 re | |
import unittest | |
class RpcIterator: | |
@staticmethod | |
def IteratorName(name): | |
# Assumption here is this string is not an existing variable. | |
# Otherwise it gets replaced. | |
return name.replace('.', '_') + '_iter' |
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
<# | |
.SYNOPSIS | |
Optimizes your PSReadline history save file. | |
.DESCRIPTION | |
Optimizes your PSReadline history save file by removing duplicate | |
entries and optionally removing commands that are not longer than | |
a minimum length | |
.EXAMPLE | |
C:\PS> Optimize-PSReadlineHistory | |
Removes all the duplicate commands. |
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
<?xml version="1.0" encoding="utf-8"?> | |
<Project DefaultTargets="compile" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<ItemDefinitionGroup> | |
<ClCompile> | |
<PreprocessorDefinitions>SomeDummyDef</PreprocessorDefinitions> | |
</ClCompile> | |
</ItemDefinitionGroup> | |
<!-- If below line is commented, Message text will be 'False'--> |
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
<Window x:Class="WpfApplication1.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="MainWindow" Height="350" Width="460"> | |
<StackPanel Orientation="Horizontal"> | |
<StackPanel Orientation="Vertical" Width="160"> | |
<Button x:Name="StartButton" Content="Start Python"/> | |
<TextBlock x:Name="Status"/> | |
</StackPanel> | |
<ContentControl Grid.Column="1" x:Name="PythonWinHost" Width="300"/> |