Skip to content

Instantly share code, notes, and snippets.

Avatar

Bojidar Marinov bojidar-bg

  • Comrade Coop
  • Bulgaria
View GitHub Profile
@bojidar-bg
bojidar-bg / ObjectParameterConstructorConverter.cs
Last active Nov 12, 2020
JsonConverter for System.Text.Json with support for immutable classes, fields, and polymorphic types
View ObjectParameterConstructorConverter.cs
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text.Json;
using System.Text.Json.Serialization;
// Via https://gist.github.com/bojidar-bg/8124db51da853384bd03f3fa0ef71a35
public class ObjectParameterConstructorConverter : JsonConverterFactory
View boxit-solver.js
// This file is made available under the GPLv3 LICENSE
// For more info, see https://www.gnu.org/licenses/gpl-3.0.html
// Based on ideas presented in https://hatnix.itch.io/boxit
function main() {
// HGrid format:
// All whitespace is ignored.
// Other characters represent tuples of color and symbol
// Colors are [w]hite/[r]ed, [b]lue, [g]reen, [o]range/[y]ellow, [p]urple/pink
@bojidar-bg
bojidar-bg / Update assets
Last active Apr 2, 2020
Scripts for updating Godot demo assets
View Update assets
Scripts for updating Godot demo assets
LICENSE:
Copyright (c) 2020 Bojidar Marinov
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
View raymarching.html
<!DOCTYPE html>
<!-- Thanks to Inigo Quillez (http://iquilezles.org) for many of the functions in the shader code. -->
<!-- Thanks to MDN for being awesome. -->
<!-- Thanks to WebGLFundamentals (https://webglfundamentals.org) for their framebuffer tutorial. -->
<!-- Thanks to gl-matrix.js for the matrix library, and Stats.js for the FPS counter. -->
<html>
<head>
<meta charset="utf-8">
<title>Raymarcher</title>
<style media="screen">
@bojidar-bg
bojidar-bg / build-helpers.sh
Last active Nov 17, 2016
Godot-buildscripts -- a few buildscripts useful for developing godot
View build-helpers.sh
#!/bin/bash
## Helps build/debug/test a Godot (usable for non-godot things as well)
##################
#-----Common-----#
##################
function start {
start=1$(date -u +"%s")
@bojidar-bg
bojidar-bg / gpfamr.sh
Last active Nov 2, 2016
GPFAMR - Godot "Project" Fixers After Mass Rename (move)
View gpfamr.sh
#!/usr/bin/env bash
v=$(echo "$@" | grep -- '-v')
d=$(echo "$@" | grep -- '-d')
sed_command=''
# Doesn't support spaces in names :|
for cf in $(find . -not -path '*.git*' -not -name '* *' -type f | sed 's|\./||g'); do
if [ ! -z "$v" ]; then
@bojidar-bg
bojidar-bg / LinkedList.gd
Last active Jan 4, 2021
Linked List for Godot
View LinkedList.gd
extends Reference
class LinkedListItem:
extends Reference
var next = null
var previous = null
var data = {}
View imagecrypt.js
function encript(current, previous) {
previous = previous || 0;
return (current + previous)%27;
}
var Canvas = require("canvas");
var fs = require("fs");
var source = process.argv[2];
//---PREPARE---
source = source.toUpperCase();