Skip to content

Instantly share code, notes, and snippets.

@fredrikhr
fredrikhr / lightshow_async.py
Created February 27, 2017 15:24
Asynchronous Lightflashing on LoPy
class FlashAsyncToken(AbortToken):
def __init__(self, color, times=1, time_on=0.1, time_off=0.1, abort_token=None):
super().__init__()
self.color = color
self.counter = 0
self.times = times
self.time_on = time_on
self.time_off = time_off
self.parent = abort_token
self.__alarm = Timer.Alarm(self.__light_on, us=5, periodic=False)
@fredrikhr
fredrikhr / airbitLedTest.ino
Created October 24, 2017 12:22
air:bit Arduino Tests
#define LED_WHITE PIN_A1
#define LED_GREEN PIN_A0
void setup() {
pinMode(LED_WHITE, OUTPUT);
pinMode(LED_GREEN, OUTPUT);
}
void loop() {
digitalWrite(LED_WHITE, HIGH);
@fredrikhr
fredrikhr / .editorconfig
Last active September 17, 2018 13:27
Dotfiles
root = true
# Defaults
[*]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.{xml,js,ts,json,*proj,targets,html,props,nim,nimble,nim.cfg}]
@fredrikhr
fredrikhr / EdgeVersionNumber.png
Last active April 13, 2019 06:47
Microsoft Edge spelling misbehaviour
EdgeVersionNumber.png
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AWSSDK.DynamoDBv2" Version="3.3.100.5" />
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.2</TargetFramework>
<UserSecretsId>0864c15e-1de4-426a-97df-a43cb2700536</UserSecretsId>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="2.2.4" />
<PackageReference Include="Microsoft.Extensions.Configuration.CommandLine" Version="2.2.0" />
@fredrikhr
fredrikhr / .editorconfig
Last active February 7, 2020 18:17
Eto.Forms Cross-platform sample
root = true
# Defaults
[*]
indent_size = 4
indent_style = space
trim_trailing_whitespace = true
insert_final_newline = true
[*.{xml,json,js,ts,jsx,tsx,vue,css,styl,*proj,targets,html,props,yml,nim,nimble,nim.cfg,wsdl,wadl,cmake}]

Create Windows Terminal shortcut in Windows + X context menu

Windows Terminal shortcut in WinX context menu

In Windows PowerShell do the following:

$folderPath = "$ENV:LOCALAPPDATA\Microsoft\Windows\WinX\Group3"
$adminFilePath = Join-Path $folderPath "00 - Windows Terminal.lnk"
$normalFilePath = Join-Path $folderPath "00a - Windows Terminal.lnk"