Skip to content

Instantly share code, notes, and snippets.

View iamhatesz's full-sized avatar

Tomasz Wrona iamhatesz

View GitHub Profile
let('the temperature sensor in kitchen')
.state(['temperature'], function (temperature) {
return temperature >= 25;
})
.cause(function (effect) {
effect('air conditioning', { state: 'on' }).now();
});
import io.circe._
import io.circe.generic.auto._
import io.circe.parser._
val jsonPoint = "{ \"type\": \"Point\", \"coordinates\": [100.0, 0.0] }"
val jsonLineString = "{ \"type\": \"LineString\",\n \"coordinates\": [ [100.0, 0.0], [101.0, 1.0] ]\n }"
val jsonPolygon = "{ \"type\": \"Polygon\",\n \"coordinates\": [\n [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ]\n ]\n }"
val jsonPolygonWithHoles = "{ \"type\": \"Polygon\",\n \"coordinates\": [\n [ [100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0] ],\n [ [100.2, 0.2], [100.8, 0.2], [100.8, 0.8], [100.2, 0.8], [100.2, 0.2] ]\n ]\n }"
val jsonGC = "{ \"type\": \"GeometryCollection\",\n \"geometries\": [\n { \"type\": \"Point\",\n \"coordinates\": [100.0, 0.0]\n },\n { \"type\": \"LineString\",\n \"coordinates\": [ [101.0, 0.0], [102.0, 1.0] ]\n }\n ]\n }"
clc
clear all
close all
syms x A E real;
p = [1 x];
xs = [0 1.5 2.1 3.14];
n = length(xs);
Kg = zeros(4, 4)
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.{Flow, Sink, Source}
object ConditionalVia extends App {
implicit val system = ActorSystem()
implicit val materializer = ActorMaterializer()
@iamhatesz
iamhatesz / wpa_supplicant.conf
Created May 17, 2017 19:37
Working wpa_supplicant.conf for Raspberry Pi Zero W
country=PL
update_config=1
ctrl_interface=/var/run/wpa_supplicant
network={
scan_ssid=1
ssid="ssid"
psk="passwd"
}
from dataclasses import dataclass
import numpy as np
import torch
from memory_profiler import profile
from tqdm import tqdm
@dataclass
class NumPyTransition: