Skip to content

Instantly share code, notes, and snippets.

View dontpaniclabsgists's full-sized avatar

Don't Panic Labs dontpaniclabsgists

View GitHub Profile
class AmazonReview
{
public string Id { get; set; }
public string ProductId { get; set; }
public string ProfileName { get; set; }
public string HelpfulnessNumerator { get; set; }
public string HelpfulnessDenominator { get; set; }
public int Score { get; set; }
public int Time { get; set; }
public string Summary { get; set; }
private bool ValidateObject(object obj, string[] allowedNulls = null)
{
if (obj == null)
{
return false;
}
foreach (PropertyInfo property in obj.GetType().GetProperties())
{
if (property.GetIndexParameters().Length > 0)
/client1
Dockerfile
client1
/client2
Dockerfile
client2
/serviceA
/serviceB
/solution.sln
# Stage 1: Build the application
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
# Copy the client1 project files
COPY client1/. ./client1/
COPY serviceA/. ./serviceA/
COPY serviceB/. ./serviceB/
WORKDIR /src/client1
async function play_notes(notes) {
for (const note of notes) {
await play_note(note);
}
}
function play_note({ note, octave, duration }) {
return new Promise((resolve) => {
// Play the note for the duration
if (note != null && octave != null) {
{
"notes": [
{
"note": "E",
"octave": 4,
"duration": 300
},
{
"note": "D",
"octave": 4,
"function": {
"name": "play_notes",
"arguments": "{\n \"notes\": [\n { \"note\": \"E\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"D\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"C\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"D\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"E\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"E\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"E\", \"octave\": 4, \"duration\": 300 },\n { \"duration\": 300 },\n { \"note\": \"D\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"D\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"D\", \"octave\": 4, \"duration\": 300 },\n { \"duration\": 300 },\n { \"note\": \"E\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"E\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"E\", \"octave\": 4, \"duration\": 300 },\n { \"duration\": 300 },\n { \"note\": \"E\", \"octave\": 4, \"duration\": 300 },\n { \"note\": \"D\", \"oc
{
"name": "play_notes",
"parameters": {
"type": "object",
"properties": {
"notes": {
"type": "array",
"description": "The ordered notes and pauses to play",
"items": {
"type": "object",
@dontpaniclabsgists
dontpaniclabsgists / angular.json
Last active November 13, 2023 21:51
Using JSON Server with Angular application configurations
// This is a partial example of the angular.json to show the new mock section under serve
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"configurations": {
"production": {
"buildTarget": "json-server-demo:build:production"
},
"development": {
"buildTarget": "json-server-demo:build:development"
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
...
<UserSecretsId>[your guid]</UserSecretsId>
</PropertyGroup>