Skip to content

Instantly share code, notes, and snippets.

View GeeWee's full-sized avatar

Gustav Wengel GeeWee

View GitHub Profile
View gist:a26ec914963ba490f102b9f0a0d9b3c7
curl --request POST \
--url \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"emission_factor": {
"id": "accommodation_type_hotel_stay",
"region": "AU"
"parameters": {
GeeWee /
Created March 8, 2022 08:27
Climatiq java example
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;
// 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
GeeWee /
Last active December 13, 2021 08:19
Advent of code day 1
<!-- Advent of code day 1 -->
pub fn calculate_part_1(input: &str) -> i32 {
let mut lines = input.lines();
let first: i32 =;
let mut larger = 0;
let mut last_line = first;
for line in lines {
View gist:2986f324add2897607debcd10da3cf5c
View gist:2da809b8db6872c25ecaf6d0dd92d448
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()) {
GeeWee / 1_Startup.cs
Last active September 13, 2021 06:30
Fun with attributes
View 1_Startup.cs
public class Startup
public void ConfigureServices(IServiceCollection services)
// 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 =>
View ScopedServiceProvider.cs
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>
View gist:2839de78743658f884729d68a9b69d06
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:
Bemærk at jvf. datatilsynet skal i imødekomme disse ønsker indenfor en måned.
GeeWee / test.cs
Created June 15, 2020 10:53
FluentAssertions ShouldBeEquivalentTo
View test.cs
using System.Collections.Generic;
using FluentAssertions;
using Xunit;
namespace AIP.FastlogFG.Test
public class FooTest
public void foo()
class ChefViewSet(AutoPrefetchMixin, ModelViewSet):
serializer_class = ItalianChefSerializer
queryset = ItalianChef.objects.all()