Skip to content

Instantly share code, notes, and snippets.

View bondarenkod's full-sized avatar

Dmytro Bondarenko bondarenkod

  • DevRain
  • Kyiv, Ukraine
View GitHub Profile
@yinyue200
yinyue200 / Page2View.cs
Last active August 13, 2020 14:01
Convert Page to View on Xamarin.forms 3.0
//*********************************************************
//
// 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.
//
//*********************************************************
@magnetikonline
magnetikonline / README.md
Last active April 29, 2024 23:45
PowerShell execute command (.exe) with arguments safely (e.g. with spaces).

PowerShell execute command with arguments safely

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.

Example

@preetpalS
preetpalS / scale_win10_uwp_assets.rb
Last active November 7, 2016 00:04
Windows 10 UWP quick-and-dirty scaled image asset generation with ImageMagick
## 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).
@DanielSWolf
DanielSWolf / Program.cs
Last active May 2, 2024 18:33
Console progress bar. Code is under the MIT License: http://opensource.org/licenses/MIT
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);
@TomByrne
TomByrne / MultiExporter.jsx
Last active May 24, 2024 15:18
An Illustrator script for exporting layers and/or artboards into separate files (PNG8 / PNG24 / EPS / PDF / SVG / JPG / FXG).See http://www.tbyrne.org/export-illustrator-layers-to-svg-files
// 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
@htuomola
htuomola / MsBuildRenameXap.xml
Last active December 21, 2015 12:59
MsBuild target to rename Windows Phone XAP packages after building to include build configuration & assembly version number. Note that as far as I know, it's not possible to delete the original XAP file as it is required for emulator deployment & debugging.
<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>
@prabirshrestha
prabirshrestha / ConsoleProgress.cs
Created July 25, 2011 20:35
C# Console Progress
public class ProgressBar
{
private int _lastOutputLength;
private readonly int _maximumWidth;
public ProgressBar(int maximumWidth)
{
_maximumWidth = maximumWidth;
Show(" [ ");
}