Skip to content

Instantly share code, notes, and snippets.

View ddamko's full-sized avatar

Derek Damko ddamko

View GitHub Profile
@ddamko
ddamko / RxDB Data Service
Created May 5, 2021 22:43
Creatiing a RxDb service class for use through out the application life cycle.
import { Injectable } from "@angular/core";
import { createRxDatabase, addRxPlugin, RxCollection, RxDatabase, RxJsonSchema } from "rxdb";
import * as pouchdbaAdapter from "pouchdb-adapter-idb";
import { BehaviorSubject } from "rxjs";
import { RxCollectionCreatorBase } from "rxdb/dist/types/types";
interface Collection {
name: string;
schema: RxJsonSchema;
}
#cloud-config
ssh_authorized_keys:
- ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAQEAyMD8pv7LRGdYrXJ5cF18LYRAcUzviJonnVkv
oH20jxHqZFNowCPz9J6dAxpCMzlBV+Bmae1FX2Sj5zmpR4Tg2WF1vpo7gkNrbOp1
zQ6fIP9v18YfN8XBac5BtTUwMaYaWv8J0eTAvnXF+qXRglpLT6tQz/6e279RxiEi
vEnzw6wyc+uPJ0YWZ32CbAGm5rSLduqJ06iDgQQluzPDXhl2SEa4ZOI2tPE/BPEH
+1Lz2YigCjCsG1MUsrtaAMwlW8T2T6DBcy0TLF0iD7oTdzNP4We1+o7AxCsTk4Cl
ZQIATY3NscXxJvsb8tF+1p7xkwcxUQ4mCchL5kVA+N46D0Tmnw==
@ddamko
ddamko / ValueObject.ts
Last active October 11, 2016 19:20
Trying to create a base Value Object class in TypeScript.
const VO = require('value-object-js');
abstract class ValueObject {
constructor(private name: string, private value: any) {
const ValueObj = VO.define(name ,{
validate: (value) => { return value }
});
return new ValueObj(value);
}
}
$computers = (gc C:\Users\winuser\scripts\computers.txt).split(",")
foreach ($computer in $computers) {
if (Test-Connection -ComputerName $computer) {
$session = New-PSSession -ComputerName $computer
Invoke-Command -Session $session -ScriptBlock {
Start-ScheduledTask "StartKiosk"
} -AsJob
}
#--------------------------------------------------------------------------------------------------
#
# File: app_endco_dental.pl
# Version: 1.00
# Date: 20120721
#
# COPYRIGHT 2012 e-Tech Solutions, Inc.
#
# Any unauthorized reproduction or use of this script in part or whole is a violation of copyright
# laws and is strictly prohibited.
Hi Derek! I'm sorry I didn't see your first email -- it ended up in my spam folder! >_<
I really appreciate your reaching out, and I'm afraid this is a trademark concern, particularly because it involves selling products with the Rust logo. :( Even though it affects good faith work like yours, protecting the trademark is something we have to do across the board.
I'm sorry to be the bearer of bad news, and I totally appreciate your intentions and efforts. You might be interested in some discussions around community design, which were kicked off here:
https://internals.rust-lang.org/t/should-rust-have-an-art-design-team/2075/19
There's a new #rust-design channel on irc.mozilla.org where people interested in community design are meeting. In general, the Rust team absolutely wants to encourage community design. But at the same time we have some constraints when it comes to trademark, particularly around the logo and certain uses of the "Rust" name. I'm hoping to help the team provide some guidance about these
@ddamko
ddamko / eventstore_test.ex
Last active August 29, 2015 14:18
Testing sending events to EventStore with Elixir
iex(1)> event = [%{"eventId" => "fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4", "eventType" => "event-type", "data" => %{"a" => "1"}}]
[%{"data" => %{"a" => "1"}, "eventId" => "fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4",
"eventType" => "event-type"}]
iex(2)> {:ok, json_event} = JSX.encode event
{:ok,
"[{\"data\":{\"a\":\"1\"},\"eventId\":\"fbf4a1a1-b4a3-4dfe-a01f-ec52c34e16e4\",\"eventType\":\"event-type\"}]"}
iex(3)> {:ok, post} = HTTPoison.request(:post, "http://127.0.0.1:2113/streams/newstream", json_event, [{"Content-Type", "vnd.eventstore.events+json"}])
{:ok,
** (exit) no process
(stdlib) gen.erl:161: :gen.call/4
(elixir) lib/gen_event.ex:519: GenEvent.rpc/2
(elixir_cqrs_es) lib/bank/bank_app.ex:11: BankApp.start/2
@ddamko
ddamko / BankPlayground.ex
Last active August 29, 2015 14:17
Elixir Playground
defmodule BankPlayground do
defmodule State do
defstruct [:id, :date_created, :balance, :changes]
@type t :: %State{}
end
defmodule AccountCreated do
defstruct [:id, :date_created]
@type t :: %AccountCreated{}