Skip to content

Instantly share code, notes, and snippets.

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

Pedro G. Dias digitaldias

🏠
Working from home
View GitHub Profile
@digitaldias
digitaldias / gist:3f3f617fb6273276b712fa990ecebf58
Last active March 25, 2017 12:00
Short demo of how to instantly turn your ESP8266 module into a webserver for polling values from an IoT Gateway
#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
const char* DeviceId = "<<your sensor id>>";
const char* WIFI_SSID = "<<your wifi SSID>>";
const char* WIFI_SECRET = "<<your wifi password>>";
ESP8266WebServer webServer(80);
@digitaldias
digitaldias / gist:dbfcc5ce87c37269b1ad304acea8fbaf
Last active May 11, 2017 13:36
Eksempel på bruk av Azure AD til å hente gruppemeldemsskap
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
namespace ConsoleApp1
{
static void Main(string[] args)
{
using Microsoft.IdentityModel.Clients.ActiveDirectory;
using Microsoft.PowerBI.Api.V2;
using Microsoft.PowerBI.Api.V2.Models;
using Microsoft.Rest;
using PowerBIEmbedded_AppOwnsData.AzureClients;
using PowerBIEmbedded_AppOwnsData.Models;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
THE LISTVIEW
<ListView Grid.Row="7"
Grid.ColumnSpan="2"
Background="Transparent"
BorderBrush="Transparent"
Foreground="Yellow"
dd:DragDrop.IsDragSource="True"
dd:DragDrop.IsDropTarget="True"
dd:DragDrop.DragAdornerTemplate="{StaticResource DragAdorner}"
ItemsSource="{Binding SelectedGroupMember.Loot}"
05:54:44.062: CPU Name: AMD Ryzen Threadripper 3970X 32-Core Processor
05:54:44.062: CPU Speed: 3693MHz
05:54:44.062: Physical Cores: 32, Logical Cores: 64
05:54:44.062: Physical Memory: 130950MB Total, 107672MB Free
05:54:44.062: Windows Version: 10.0 Build 19041 (release: 2004; revision: 508; 64-bit)
05:54:44.062: Running as administrator: true
05:54:44.062: Aero is Enabled (Aero is always on for windows 8 and above)
05:54:44.062: Windows 10 Gaming Features:
05:54:44.062: Game Bar: Off
05:54:44.062: Game DVR: Off
@digitaldias
digitaldias / gist:a789f430383e319a9e4f975a89e2585d
Created December 4, 2022 14:34
Playing with strings in .Net6 and 7
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using Microsoft.Extensions.Logging;
[MemoryDiagnoser(false)]
public class Program
{
private const string template = "This is the {0} template with {1} valued at {2}";
private readonly ILogger<StringBench> _logger;
private readonly ILoggerFactory _loggerFactory = LoggerFactory.Create(builder =>