Skip to content

Instantly share code, notes, and snippets.

View pczajkowski's full-sized avatar
🙉
I have no idea what I'm doing

Piotr Czajkowski pczajkowski

🙉
I have no idea what I'm doing
View GitHub Profile
@pczajkowski
pczajkowski / Comparison.cs
Created January 21, 2024 14:08
CsvHelper vs Sep in the land of bad CSVs
namespace CSVHelperVsSep;
public class Comparison
{
public string? Original;
public string? Sep;
public string? CsvHelper;
}
@pczajkowski
pczajkowski / Djikstra.cs
Created December 21, 2017 11:10
Djikstra algorithm for C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
// Adapted from JavaScript example in The Imposter's Hanbook by Rob Conery
// Doesn't support negative edges!
namespace Djikstra
{
@pczajkowski
pczajkowski / BellmanFord.cs
Last active March 16, 2022 11:42
Bellman Ford Algorithm in C#
using System;
using System.Collections.Generic;
using System.Linq;
// Adapted from JavaScript example in The Imposter's Handbook by Rob Conery
namespace BellmanFord
{
class Path
{
@pczajkowski
pczajkowski / NoDuplicatedSource.cs
Created June 24, 2021 08:34
Remove segments where source is duplicated from TMX file while streaming it
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
namespace DuplicatesInTMX
{
class Program
{
#define _GNU_SOURCE //asks stdio.h to include asprintf
#include <archive.h>
#include <archive_entry.h>
#include <stdlib.h>
#include <string.h>
#include "stopif.h"
char* printFileSize(long int size){
char *fileSize;
/*
csvtest - reads CSV data from stdin and output properly formed equivalent
useful for testing the library
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
@pczajkowski
pczajkowski / translations.txt
Created October 8, 2020 16:52
translations.txt
constant "someID", "sourceText"
translation
constant "someOtherID", "otherSourceText
which is multiline"
another translation
@pczajkowski
pczajkowski / epidemic.js
Created May 10, 2020 14:55
Coding dojo golf
const WIDTH = 8;
const HEIGHT = 8;
// https://www.coding-dojo-silesia.pl/golf
function point_free(x, y, people) {
const pLength = people.length;
for (let i = 0; i < pLength; i++) {
const person = people[i];
if (x === person.x && y === person.y)
@pczajkowski
pczajkowski / printTextForGivenElement.js
Created April 10, 2020 11:19
printTextForGivenElement.js
const fs = require('fs');
const cheerio = require('cheerio');
const puppeteer = require('puppeteer');
let app = {};
app.parse = async function(data, elementSelector) {
if (data.length === 0) {
console.log("No data!");
return;
}

Keybase proof

I hereby claim:

  • I am pczajkowski on github.
  • I am pczajkowski (https://keybase.io/pczajkowski) on keybase.
  • I have a public key whose fingerprint is 661E A005 5FE5 39D5 5B06 2876 9AF4 CFB6 E475 1A47

To claim this, I am signing this object: