This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (_environment.IsDevelopment()) | |
{ | |
var amazonS3 = new AmazonS3Client(new BasicAWSCredentials("abc", "def"), new AmazonS3Config | |
{ | |
ServiceURL = "http://localhost:4572", | |
ForcePathStyle = true, | |
UseHttp = true | |
}); | |
services.AddSingleton(typeof(IAmazonS3), provider => amazonS3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (_environment.IsDevelopment()) | |
{ | |
services.AddSingleton<IAmazonDynamoDB>(sp => | |
{ | |
var clientConfig = new AmazonDynamoDBConfig | |
{ | |
ServiceURL = "http://localhost:4569", | |
UseHttp = true | |
}; | |
return new AmazonDynamoDBClient(new BasicAWSCredentials("abc", "def"), clientConfig); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.7' | |
services: | |
localstack: | |
network_mode: bridge | |
image: localstack/localstack:latest | |
container_name: localstack | |
environment: | |
- SERVICES=s3:4572,ssm:4583,dynamodb:4569 | |
- DATA_DIR=/tmp/localstack/data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type: conditional | |
conditions: | |
- entity: sensor.apartment_power_total | |
state_not: "off" | |
card: | |
type: vertical-stack | |
cards: | |
- type: custom:auto-entities | |
card: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"3c8ad50a.81cbba","type":"subflow","name":"Subflow 1","info":"","category":"","in":[{"x":-20,"y":80,"wires":[{"id":"6d65619b.8360a"}]}],"out":[],"env":[{"name":"message","type":"str","value":"Hello","ui":{"label":{"en-US":"Message"}}},{"name":"title","type":"str","value":"","ui":{"label":{"en-US":"Notification title"}}}],"color":"#DDAA99"},{"id":"8f27018e.a9918","type":"api-call-service","z":"3c8ad50a.81cbba","name":"Send notification","server":"8501408e.93b69","version":1,"debugenabled":true,"service_domain":"notify","service":"mobile_app_galaxy_s9","entityId":"","data":"{\"message\": $env('message'), \"title\": $env('title')}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":810,"y":60,"wires":[[]]},{"id":"6d65619b.8360a","type":"time-range-switch","z":"3c8ad50a.81cbba","name":"Is it between 10 PM and 8 AM?","lat":"","lon":"","startTime":"22:00","endTime":"08:00","startOffset":0,"endOffset":0,"x":210,"y":80,"wires":[[],["d710e0e9.28 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
msg.headers = {}; | |
msg.method = "POST"; | |
msg.url = "https://api.todoist.com/sync/v8/sync"; | |
var taskId = "4271193756"; | |
msg.payload = "token=<insert your token here>&commands=%5B%7B%22type%22%3A%20%22item_update_date_complete%22%2C%20%22uuid%22%3A%20%22" + | |
'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | |
var r = Math.random() * 16 | 0, v = c == 'x' ? r : (r & 0x3 | 0x8); | |
return v.toString(16); | |
}) + "%22%2C%20%22args%22%3A%20%7B%22id%22%3A%20" + taskId + "%7D%7D%5D" | |
msg.headers["content-type"] = "application/x-www-form-urlencoded" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var: | |
latest_hashnode_article_id: | |
friendly_name: 'Latest article ID' | |
icon: 'mdi:blogger' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
user(username: "bogdan") { | |
publication { | |
posts(page: 0){ | |
cuid, | |
title | |
} | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static void AddResultsFromVotes(StringBuilder html, string name, decimal voteCount, Dictionary<string, int> dictionary, int cancelledVotes) | |
{ | |
var sum = dictionary.Sum(c => c.Value); | |
var index = 1; | |
html.Append($"<br/>"); | |
html.Append($"<h2>Voturi {name}</h2><br />"); | |
html.Append($"Total voturi {name}: {voteCount}<br />"); | |
html.Append($"Total voturi anulate in {name}: {cancelledVotes}<br />"); | |
voteCount -= cancelledVotes; | |
var countedPercentage = Math.Round(sum / (decimal)voteCount * 100, 2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{"id":"9ca1657d.057fd8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"7cca5834.d24008","type":"api-call-service","z":"9ca1657d.057fd8","name":"Change office lightstrip","server":"8501408e.93b69","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.office_lightstrip","data":"{\t \"brightness\": msg.data.new_state.attributes.brightness,\t \"rgb_color\": msg.data.new_state.attributes.rgb_color\t}","dataType":"jsonata","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":540,"y":120,"wires":[["1489ac11.df6254"]]},{"id":"b8f1a35c.90226","type":"server-state-changed","z":"9ca1657d.057fd8","name":"Bedroom lightstrip changed","server":"8501408e.93b69","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"light.bedroom_lightstrip","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type" |