Skip to content

Instantly share code, notes, and snippets.

View stravid's full-sized avatar

David Strauß stravid

View GitHub Profile
{
oldPkgs ? import (fetchGit {
url = https://github.com/NixOS/nixpkgs;
ref = "3b9b8726bdbb5405919c40920d9693c5eae246b5";
}) {},
newPkgs ? import (fetchGit {
url = https://github.com/NixOS/nixpkgs;
ref = "nixos-19.03";
}) {}
}:
@stravid
stravid / machine.js
Created October 30, 2020 07:12
Generated by XState Viz: https://xstate.js.org/viz
const onlineTestMachine = Machine({
id: 'Online-Test',
initial: 'daten_laden',
context: {
beispielaufgaben: [1, 2, 3],
testteile: [
[4, 5, 6, 7],
[8, 9],
[10, 11, 12],
],
@stravid
stravid / machine.js
Created June 4, 2020 12:33
Generated by XState Viz: https://xstate.js.org/viz
const Soll = Machine({
id: 'Soll Stand',
initial: 'AngeforderterPosten',
states: {
AngeforderterPosten: {
on: {
stellen: 'GestellterPosten',
abbrechen: 'AbgebrochenerPosten',
}
},
@stravid
stravid / machine.js
Last active May 26, 2020 11:40
Generated by XState Viz: https://xstate.js.org/viz
const Soll = Machine({
id: 'Soll Stand',
initial: 'Leer',
states: {
Leer: {
on: {
anfrageErhalten: 'Anfrage',
angebotAngefragt: 'AngefordertesAngebot'
},
},
@stravid
stravid / machine.js
Last active May 26, 2020 10:26
Generated by XState Viz: https://xstate.js.org/viz
const Ist = Machine({
id: 'Ist Stand',
initial: 'Leer',
states: {
Leer: {
on: {
anfrageErhalten: 'Anfrage',
angebotAngefragt: 'AngefordertesAngebot'
},
},
@stravid
stravid / child-machine.js
Last active March 23, 2020 16:28
Statechart Parent Child Activity Example
const { Machine } = XState;
export default Machine({
id: 'child',
initial: 'present',
context: {
name: undefined
},
states: {
present: {
@stravid
stravid / SketchSystems.spec
Last active February 9, 2019 08:54
Pre-Match*
Pre-Match*
start match -> Match
Match
Starting Order*
play -> Game
Game
Running?*
another dart can be thrown? -> During
no dart can be thrown? -> After
During
class Web < Roda
def initialize(database_url:)
@database_url = database_url
end
route do |r|
r.root do
"Configured database URL: #{@database_url}"
end
end
require "rubygems"
require "bundler/setup"
require "concurrent"
tasks = 10.times.map do |s|
Concurrent::TimerTask.new(execution_interval: 1) do
sleep s
puts "s: #{s}\n"
end
end
require "socket"
server_ip = "192.168.1.14"
client_ip = "192.168.1.5"
server_port = 22040
server_socket = UDPSocket.new
server_socket.connect(server_ip, server_port)
name = "Schorsch-Klaus-David-#{rand}"