This file contains hidden or 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
curl --request POST \ | |
--url https://beta3.api.climatiq.io/estimate \ | |
--header 'Authorization: Bearer YOUR_API_KEY' \ | |
--header 'Content-Type: application/json' \ | |
--data '{ | |
"emission_factor": { | |
"id": "accommodation_type_hotel_stay", | |
"region": "AU" | |
}, | |
"parameters": { |
This file contains hidden or 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
import com.fasterxml.jackson.databind.ObjectMapper; | |
import models.ClimatiqEstimateResponse; | |
import org.apache.hc.client5.http.classic.methods.HttpPost; | |
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient; | |
import org.apache.hc.client5.http.impl.classic.HttpClients; | |
import org.apache.hc.core5.http.io.entity.EntityUtils; | |
import org.apache.hc.core5.http.io.entity.StringEntity; | |
// Example of how to use Java to use the climatiq API | |
// This example requires jackson and apache's HttpClient to be installed into the project |
This file contains hidden or 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
<!-- Advent of code day 1 --> | |
pub fn calculate_part_1(input: &str) -> i32 { | |
let mut lines = input.lines(); | |
let first: i32 = lines.next().unwrap().parse().unwrap(); | |
let mut larger = 0; | |
let mut last_line = first; | |
for line in lines { |
This file contains hidden or 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
<PropertyGroup> | |
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles> | |
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath> | |
</PropertyGroup> |
This file contains hidden or 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
function doWork() { | |
const candidateForm = document.querySelector("#candidate-form") | |
candidateForm.addEventListener("submit", (e) => { | |
console.log("form submitted"); | |
const formData = new FormData(document.querySelector('form')) | |
for (var pair of formData.entries()) { |
This file contains hidden or 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
public class Startup | |
{ | |
public void ConfigureServices(IServiceCollection services) | |
{ | |
services.AddControllers(); | |
// This uses Scrutor to scan for all classes with a [Transient] [Scoped] or [Singleton] attribute and adds them as any matching interfaces | |
// No need to add any extra logic in Startup.cs when defining classes | |
services.Scan(i => | |
i.FromCallingAssembly() |
This file contains hidden or 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
using System; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace Scopes | |
{ | |
/// <summary> | |
/// This allows access to a Scoped or transient service outside of a scope. It returns a scope and a service. | |
/// The scope must be disposed of, after you're done with the service | |
/// </summary> | |
/// <typeparam name="T">The type of the service</typeparam> |
This file contains hidden or 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
Hej. | |
Pga. jeres dårlige behandling af jeres medarbejdere vil jeg gerne officielt benytte af mine rettigheder under GDPR til: | |
- At få udleveret en kopi af alle de personoplysninger i har tilknyttet til kontoen som jeg sender denne her mail fra. (Retten til dataportabillitet) | |
- At i sletter kontoen som denne mail er tilknyttet. (Ikke ift. GDPR, jeg vil bare ikke være kunde længere) | |
- At i sletter alle personoplysninger om mig. (Retten til at blive glemt) | |
I kan se denne skabelon fra datatilsynet eller rådføre jer med lovteksten hvis i har yderligere spørgsmål: | |
https://www.datatilsynet.dk/Media/2/3/Generel%20informationspjece%20(3).pdf | |
Bemærk at jvf. datatilsynet skal i imødekomme disse ønsker indenfor en måned. |
This file contains hidden or 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
using System.Collections.Generic; | |
using FluentAssertions; | |
using Xunit; | |
namespace AIP.FastlogFG.Test | |
{ | |
public class FooTest | |
{ | |
[Fact] | |
public void foo() |
This file contains hidden or 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
class ChefViewSet(AutoPrefetchMixin, ModelViewSet): | |
serializer_class = ItalianChefSerializer | |
queryset = ItalianChef.objects.all() |
NewerOlder