Skip to content

Instantly share code, notes, and snippets.

View davamix's full-sized avatar
💻
Playing with code

Daniel Valcarce davamix

💻
Playing with code
View GitHub Profile
GitHub Activity
@davamix
davamix / main.yml
Created June 9, 2020 01:04
GitHub Actions: Build a Xamarin.Forms project and create the APK
name: Build
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
# Build App
<!DOCTYPE html>
<!-- https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API -->
<html>
<!-- The body has height of 300px of effective area to drop the elements -->
<body id="body" ondrop="drop_handler(event)" ondragover="dragover_handler(event)" style="height: 300px;">
<div id="div1" draggable="true" ondragstart="dragstart_handler(event)" ondrop="drop_handler(event)" ondragover="dragover_handler(event)" style="background-color: gold; padding: 10px;">Draggable item A</div>
<div id="div2" draggable="true" ondragstart="dragstart_handler(event)" ondrop="drop_handler(event)" ondragover="dragover_handler(event)" style="background-color: deepskyblue; padding: 10px;">Draggable item B</div>
</body>
@davamix
davamix / inference.py
Created March 21, 2020 21:22
Changes to train with Centermask2
import os
import random
import cv2
#from detectron2.config import get_cfg
from centermask.config import get_cfg
from detectron2 import model_zoo
from detectron2.engine import DefaultPredictor
from detectron2.utils.visualizer import Visualizer, ColorMode
from detectron2.data import MetadataCatalog
appuser@0350938812fa:/tmp/src$ python3 test.py
Failed to load OpenCL runtime
## PROPOSALS ##
Instances(num_instances=2000, image_height=573, image_width=687, fields=[proposal_boxes, objectness_logits])
## FIELDS ##
{'proposal_boxes': Boxes(tensor([[286.9893, 37.3016, 687.0000, 536.0049],
[161.1793, 62.7907, 687.0000, 573.0000],
[256.4062, 144.6316, 687.0000, 573.0000],
...,
[464.0695, 306.8295, 477.6617, 346.7988],
@davamix
davamix / asp.net core 2 with https.md
Last active October 10, 2023 20:27
Configure a self-signed certificate in Ubuntu to allow HTTPS access with an ASP.NET Core 2.1 application

Configure a self-signed certificate in Ubuntu to allow HTTPS access with an ASP.NET Core 2.1 application

  1. Create an asp.net core project as usual and check if you have access using HTTPS.
dotnet new web -o Sample
cd Sample
dotnet restore
dotnet run
@davamix
davamix / Derived.cpp
Last active January 2, 2018 02:08
Is possible to move the implementation of Run function from Derived.h to Derived.cpp?
#include <iostream>
#include "IBase.h"
#include "Derived.h"
void Derived::IBase::Run(){
std::cout << "Hello from derived" << std::endl;
}
@davamix
davamix / Install .NET 3.5 on Windows 10.txt
Created April 25, 2017 09:54
Install .NET Framework 3.5 on Windows 10
On Windows 10 is not possible to install .NET Framework 3.5 using the "Turn Windows features on or off" option because the error 0x800F081F.
In my case I installed it following the steps below:
1. Go to https://my.visualstudio.com and download "Windows 10 Features on Demand" iso (x86 or x64).
2. Mount the iso
3. Open a PowerShell command line as Administrator and run the next command
3.1 Dism /online /enable-feature /featurename:NetFX3 /All /Source:D:\ /LimitAccess
The output should something like this:
----------------------------------------
<Button Content="Hello" Command="{Binding HelloCommand}"/> <!-- Works OK --> 
<Button Content="Hello" Command="{Binding HelloCompositeCommand}"/> <!-- Nope :( -->
public class MainWindowViewModel : BindableBase
    {
        public DelegateCommand HelloCommand { get; set; }
 public CompositeCommand HelloCompositeCommand { get; set; }
@davamix
davamix / Howto - Nuget Server.md
Last active August 20, 2016 19:30
Create and configure a local NuGet server

Nuget Server

  • Create an ASP.NET web project with the Empty template
  • Install the Nuget.Server package
  • Publish the project to the IIS server

Publish options:

Connection