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
public class ProgressBar | |
{ | |
private int _lastOutputLength; | |
private readonly int _maximumWidth; | |
public ProgressBar(int maximumWidth) | |
{ | |
_maximumWidth = maximumWidth; | |
Show(" [ "); | |
} |
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
<Target Name="AfterBuild"> | |
<GetAssemblyIdentity AssemblyFiles="$(OutputPath)\$(AssemblyName).dll"> | |
<Output TaskParameter="Assemblies" ItemName="MyAssemblyIdentities" /> | |
</GetAssemblyIdentity> | |
<PropertyGroup> | |
<XapFilenameWithoutExt>$(XapFilename.Replace('.xap',''))</XapFilenameWithoutExt> | |
<OutputXapFilename>$(XapFilenameWithoutExt)_$(Configuration)_%(MyAssemblyIdentities.Version).xap</OutputXapFilename> | |
</PropertyGroup> | |
<Message Text="Removing all files matching with '$(XapFilenameWithoutExt)_*.xap'" /> | |
<ItemGroup> |
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
// MultiExporter.jsx | |
// Version 0.1 | |
// Version 0.2 Adds PNG and EPS exports | |
// Version 0.3 Adds support for exporting at different resolutions | |
// Version 0.4 Adds support for SVG, changed EPS behaviour to minimise output filesize | |
// Version 0.5 Fixed cropping issues | |
// Version 0.6 Added inner padding mode to prevent circular bounds clipping | |
// | |
// Copyright 2013 Tom Byrne | |
// Comments or suggestions to tom@tbyrne.org |
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; | |
using System.Threading; | |
static class Program { | |
static void Main() { | |
Console.Write("Performing some task... "); | |
using (var progress = new ProgressBar()) { | |
for (int i = 0; i <= 100; i++) { | |
progress.Report((double) i / 100); |
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
## Instructions | |
# 1. Place this file (modified appropriately with your paths) in folder with images to be scaled. | |
# 2. Run this file with Ruby (e.g. "ruby scale_win10_uwp_assets.rb"). | |
## Results | |
# Creates a folder named "compiled_images" with scaled images. | |
## Notes | |
# You should create appropriate versions of your assets for different uses (and their scales and/or targets). |
In my opinion this is the best way for executing external commands from PowerShell with arguments in a safe manner - via the use of an array to hold the arguments.
Consider this one a PowerShell gem to keep in the toolbox.
Note
The example below makes use of EchoArgs.exe
- a small utility that simply echoes back arguments passed to it. Utility is part of the PowerShell Community Extensions, or the exe alone can be downloaded at https://ss64.com/ps/EchoArgs.exe.
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
//********************************************************* | |
// | |
// Copyright (c) yinyue200.com. All rights reserved. | |
// This code is licensed under the MIT License (MIT). | |
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF | |
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY | |
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR | |
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. | |
// | |
//********************************************************* |