Skip to content

Instantly share code, notes, and snippets.

View pimms's full-sized avatar
🥰

Joakim Bull-Stien pimms

🥰
View GitHub Profile
@pimms
pimms / ec1.c
Created March 4, 2026 20:45
everybody.codes1.c
#include <_stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void part1()
{
int result = 0;
void* fh = fopen("input.txt", "r");
@pimms
pimms / dec5.c
Last active December 11, 2025 17:39
dec5.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
long min(long a, long b) { if (a < b) return a; return b; }
long max(long a, long b) { if (a > b) return a; return b; }
struct Node
{
@pimms
pimms / dec4.c
Created December 10, 2025 16:31
dec4.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// Poor man's enum
const int FREE = 1;
const int ROLL = 2;
struct Node
{
@pimms
pimms / dec3.c
Created December 3, 2025 20:39
dec3.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int joltage_p1(char *str)
{
const int len = strlen(str);
char *c1base = str;
int c2base = 1;
@pimms
pimms / dec2.c
Last active December 2, 2025 18:33
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
struct range
{
long from;
long to;
};
@pimms
pimms / dec1.c
Created December 2, 2025 07:38
AOC
#include <stdio.h>
#include <stdlib.h>
void brute()
{
char* buf = malloc(16);
void* file = fopen("sample.txt", "r");
if (!file) return;
int dial = 50;
@pimms
pimms / dec1.cpp
Created December 1, 2020 15:04
aoc2020-1
#include <stdio.h>
#include <iostream>
#include <vector>
#include <fstream>
#include <algorithm>
std::vector<int> read()
{
std::vector<int> result;
std::ifstream file("1.txt");
@pimms
pimms / Library1.cpp
Last active September 3, 2018 14:31
POC for google/googletest PR #1578
#include <stdio.h>
#include <gtest/gtest.h>
TEST(Lib1, EnTest)
{
ASSERT_EQ(15, 15);
}
@pimms
pimms / Source Files
Last active October 2, 2017 15:03
Googletest pull request samples
/* LIBRARY 1 */
include <stdio.h>
#include <gtest/gtest.h>
TEST(Lib1, EnTest)
{
ASSERT_EQ(15, 15);
}
/* LIBRARY 2 */
@pimms
pimms / poetry.cpp
Created July 3, 2015 14:41
Poetry Haystack
#include <iostream>
#include <string>
#include <memory>
#include <fstream>
#include <vector>
#include <sstream>
class Dictionary
{