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}]
@fredrikhr
fredrikhr / GoogleOrToolsDotnetCore.dockerfile
Last active June 24, 2020 22:02
GoogleOrToolsDotnetCore
# docker build -t fredrikhr/googleortools-tsp-sample-dotnetcore -f GoogleOrToolsDotnetCore.dockerfile https://gist.github.com/6cae577fcedba6311402c7e4ccefc021.git
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-bionic AS build
WORKDIR /app/GoogleOrToolsDotnetCore
# Install curl
RUN set -x \
# APT Update & Upgrade
&& apt-get update \
&& apt-get upgrade --yes 2>&1 \