Skip to content

Instantly share code, notes, and snippets.

View msilvestro's full-sized avatar

Matteo Silvestro msilvestro

View GitHub Profile
@msilvestro
msilvestro / ParallelBuild.ps1
Last active May 18, 2023 22:09
Run a Unity build while continuing to work on your project.
function Copy-UnityProject {
param (
[string] $ProjectPath = "."
)
$ProjectPath = Resolve-Path -Path $ProjectPath
$projectFolder = $ProjectPath | Split-Path -Leaf
$tempProjectPath = Join-Path -Path $env:TEMP -ChildPath $projectFolder
& robocopy $ProjectPath $tempProjectPath /mir `
/xd (Join-Path -Path $ProjectPath -ChildPath Build) `
@msilvestro
msilvestro / resume.yml
Last active December 19, 2023 22:59
My resume
name: Matteo Silvestro
email: matteosilvestro@live.it
website: https://matteosilvestro.com
summary: |
I'm a passionate but down-to-earth developer with a mathematician's mindset.
work:
- company: Gorgias
position: Full-Stack Developer
start_date: 2023-05
summary: |
@msilvestro
msilvestro / !image_restore.R
Last active April 26, 2021 22:00
Coupling from the past (CFTP) for image restoration
# Created by Matteo Silvestro for an essay about CFTP algorithm # 16/06/2016 # CC BY
library(pixmap) # to extract a matrix of zeros and ones from a binary image
library(grid) # to display a matrix of zeros and ones in R
# I define as one-line-matrix a square matrix with all elements in a single vector.
# It is easy to get a virtual matrix from such vector by setting number of cols/rows = sqrt(length of vector)
# draw the one-line-matrix of -1 and +1 as an image in R
drawImage <- function(image) {
@msilvestro
msilvestro / ReplaceInExcelFile.ps1
Created November 15, 2020 21:27
Replace cell contents in an Excel file.
function Update-ReplaceInExcelFile {
<#
.SYNOPSIS
Replace cell contents in an Excel file.
.EXAMPLE
Update-ReplaceInExcelFile -ExcelFile "C:\work.xls" -replace "2020", "2021"
This replace all occurences of "2020" with "2021" inside the provided Excel file.
#>
@msilvestro
msilvestro / MainActivity.java
Created March 11, 2017 21:50
XML code for the "Single Screen App" project for the "Android Basics: User Interface" Udacity course
package com.example.android.singlescreenapp;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@msilvestro
msilvestro / activity_main.xml
Created January 16, 2017 22:36
Code for the "Make Your Own Card" challenge from the "Android Basics: User Interface" Udacity course
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/activity_main"
tools:context="it.matteosilvestro.monkeycard.MainActivity"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@android:color/black">