Skip to content

Instantly share code, notes, and snippets.

View albertospelta's full-sized avatar
🏠
Working from home

Alberto Spelta albertospelta

🏠
Working from home
View GitHub Profile

Keybase proof

I hereby claim:

  • I am albertospelta on github.
  • I am albertospelta (https://keybase.io/albertospelta) on keybase.
  • I have a public key whose fingerprint is 7A3A 0392 6F21 F796 C5DB 8005 1EAD 3C54 A167 6653

To claim this, I am signing this object:

@albertospelta
albertospelta / SSASEventStreamSample.cs
Last active October 23, 2019 12:54
Collect streaming xEvents with C#
namespace SSASEventStreamSample
{
using Microsoft.AnalysisServices.AdomdClient;
using Microsoft.SqlServer.XEvent.Linq;
using System;
using System.Data;
using System.Xml;
class Program
{
@albertospelta
albertospelta / chocolatey-setup-env.ps1
Last active November 15, 2017 12:42
My @chocolateynuget install
Set-ExecutionPolicy Bypass
Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install googlechrome /y
choco install notepadplusplus /y --x86
choco install visualstudio2017community /y
choco install visualstudiocode /y --params '"/NoDesktopIcon"'
choco install sql-server-management-studio /y
choco install 7zip /y
choco install conemu /y
@albertospelta
albertospelta / zenburn-theme.xml
Created October 13, 2017 15:27
Zenburn-like style for Notepad++
<?xml version="1.0" encoding="Windows-1252" ?>
<!--
File name: Zenburn.xml
Style Name: Zenburn
Description: Zenburn-like style for Notepad++.
Inspired by the original Zenburn colorscheme for Vim by Jani Nurminen.
Official Vim Zenburn home page: http://slinky.imukuppi.org/zenburnpage/
Supported languages: All the languages supported by release 5.6.4
Created by: Jani Kesänen (jani dot kesanen gmail com)
Released: 12.01.2010
@albertospelta
albertospelta / install-spark-anaconda-ubuntu-1804LTS.sh
Last active May 9, 2019 18:43
Install Spark standalone and Anaconda distribution on Ubuntu 18.04 LTS
#!/bin/bash
# Install Spark and Anaconda distribution on Ubuntu 18.04 LTS
sudo apt-get update && sudo apt-get upgrade
# install oracle jdk
sudo add-apt-repository ppa:webupd8team/java
sudo apt update && sudo apt install oracle-java8-set-default
@albertospelta
albertospelta / SampleException.cs
Created October 16, 2018 10:47
Template for creating custom exceptions
using System;
using System.Runtime.Serialization;
using System.Security.Permissions;
namespace App.Infrastructure.Exceptions
{
[Serializable]
public class SampleException: Exception, ISerializable
{
public string CustomErrorProperty { get; set; }
@albertospelta
albertospelta / Query-PowerBIDataset.ps1
Last active May 6, 2023 19:06
An example of how to query a PowerBI dataset using Powershell and AdomdClient
$ErrorActionPreference = "Stop"
function LoadAdomdClientPackage() {
$package = Get-Package -Name Microsoft.AnalysisServices.AdomdClient.retail.amd64 -ErrorAction SilentlyContinue
if (!$package) {
Install-Package -Name Microsoft.AnalysisServices.AdomdClient.retail.amd64 -RequiredVersion 19.61.1.4 -ProviderName NuGet -Source "https://www.nuget.org/api/v2" -Scope CurrentUser -SkipDependencies -Force
$package = Get-Package -Name Microsoft.AnalysisServices.AdomdClient.retail.amd64
}
$assemblyPath = Join-Path (Get-ChildItem $package.Source).DirectoryName "lib\net45\Microsoft.AnalysisServices.AdomdClient.dll"
try { Add-Type -Path $assemblyPath} catch { $_.Exception.LoaderExceptions }