Skip to content

Instantly share code, notes, and snippets.

View felipebaltazar's full-sized avatar
👋

Felipe Baltazar felipebaltazar

👋
View GitHub Profile
@felipebaltazar
felipebaltazar / AdbPushFiles.bat
Last active September 25, 2018 12:47
send a file to device on adb connection
@echo off
echo ===========Adb device push file script===========
echo Author: Felipe Baltazar
echo Github:https://github.com/felipebaltazar
echo Creation Date: 25/09/2018
echo.
echo.
echo ====================Status=====================
echo [%time%] Checking adb default path...
@felipebaltazar
felipebaltazar / AdbDeviceConnect.bat
Created September 25, 2018 12:46
Create a adb connection
@echo off
echo ===========Adb device connect script===========
echo Author: Felipe Baltazar
echo Github:https://github.com/felipebaltazar
echo Creation Date: 25/09/2018
echo.
echo.
echo ====================Status=====================
echo [%time%] Checking adb default path...
call CD D:\Android\android-sdk\platform-tools\
function fitTextToview(view) {
const previousFontSize = view.style.fontSize;
const originalWidth = innerWidth(view);
const originalHeight = innerHeight(view);
var low = 5;
var high = originalHeight;
var mid = 0;
while (low <= high) {
mid = parseInt((low + high) / 2, 10);
@felipebaltazar
felipebaltazar / linker.xml
Created May 15, 2019 12:24
basic linker file for Prism + DryIoc
<?xml version="1.0" encoding="UTF-8"?>
<linker>
<assembly fullname="DryIoc">
<type fullname="DryIoc.CurrentScopeReuse*" />
<type fullname="DryIoc.Registrator*" />
<type fullname="DryIoc.IResolver*" />
<type fullname="DryIoc.Resolver*" />
<type fullname="DryIoc.ResolutionScopeName*" />
<type fullname="DryIoc.Request*">
<method name="Push" />
@felipebaltazar
felipebaltazar / .editorconfig
Created May 15, 2019 12:25
simple editor config with naming convencions
# Rules in this file were initially inferred by Visual Studio IntelliCode from the D:\Simix\SuperMidia\Xamarin\simix.supermidia\simix.supermidia\ codebase based on best match to current usage at 24/04/2019
# You can modify the rules from these initially generated values to suit your own policies
# You can learn more about editorconfig here: https://docs.microsoft.com/en-us/visualstudio/ide/editorconfig-code-style-settings-reference
[*.cs]
# top-most EditorConfig file
root = true
###############################
# Naming Conventions #
@felipebaltazar
felipebaltazar / appcenter-pre-build.sh
Last active October 1, 2019 13:34
Version bump for android on AppCenter
#!/usr/bin/env bash
#
#AN IMPORTANT THING: YOU NEED DECLARE VERSION_MAJOR AND VERSION_MINOR ENVIRONMENT VARIABLES IN APP CENTER BUILD CONFIGURATION.
echo "=============================================================================="
echo "Task : Version bumping"
echo "Description : Set the new version on AndroidManifest with current appcenter build id."
echo "Version : 1.0.0"
echo "Author : Felipe baltazar - Felipe.baltazar@simix.com.br"
echo "Help : [More Information](https://github.com/felipebaltazar)"
@felipebaltazar
felipebaltazar / appcenter-post-build.sh
Created October 1, 2019 13:36
NUnit tests on app center
#!/usr/bin/env bash
#
# For Xamarin, run all NUnit test projects that have "Test" in the name.
# The script will build, run and display the results in the build logs.
echo ""
echo "=============================================================================="
echo "Task : Unit Tests"
echo "Description : Run unit tests and print results."
echo "Version : 1.0.0"
private void OnCanvasViewPaintSurface(object sender, SKPaintSurfaceEventArgs e)
{
var info = e.Info;
var surface = e.Surface;
var canvas = surface.Canvas;
//Essa diferença é calculada para manter o desenho em proporção 1:1
//Ou seja, estou vendo quem é maior (largura ou altura) para definir um valor
//a ser ajustado na largura ou na altura.
var diferenceX = info.Width > info.Height ? (info.Width - info.Height) / 2 : 0;
private void RefreshChartValues(float currentValue, float maxValue)
{
if (currentValue >= maxValue)
dataSweepAngle = backgroundSweepAngle;
if (currentValue <= 0)
dataSweepAngle = 1;
var valuePercentage = (currentValue * 100f) / maxValue;
dataSweepAngle = (valuePercentage * backgroundSweepAngle) / 100f;
using SkiaSharp;
using SkiaSharp.Views.Forms;
using System;
using System.Threading.Tasks;
using Xamarin.Forms;
using Xamarin.Forms.Xaml;
namespace CustomCharts.View
{
#if Release