Skip to content

Instantly share code, notes, and snippets.

View rainbyte's full-sized avatar

Alvaro Fernando García rainbyte

View GitHub Profile
@rainbyte
rainbyte / ss_ps_fil_to_orca_fil.py
Created August 12, 2024 16:23 — forked from samwiseg0/ss_ps_fil_to_orca_fil.py
Convert SuperSlicer/PrusaSlicer filament profiles to OrcaSlicer
# -*- coding: utf-8 -*-
import argparse
import configparser
import json
import os
def sanitize_value(value):
# Remove leading and trailing whitespaces, including newline characters
value = value.strip()
# Remove any extra quotes or escape characters
@rainbyte
rainbyte / Git Subtree basics.md
Created August 6, 2024 01:33 — forked from SKempin/Git Subtree basics.md
Git Subtree basics

Git Subtree Basics

If you hate git submodule, then you may want to give git subtree a try.

Background

When you want to use a subtree, you add the subtree to an existing repository where the subtree is a reference to another repository url and branch/tag. This add command adds all the code and files into the main repository locally; it's not just a reference to a remote repo.

When you stage and commit files for the main repo, it will add all of the remote files in the same operation. The subtree checkout will pull all the files in one pass, so there is no need to try and connect to another repo to get the portion of subtree files, because they were already included in the main repo.

Adding a subtree

Let's say you already have a git repository with at least one commit. You can add another repository into this respository like this:

@rainbyte
rainbyte / QuickStart.fs
Created November 25, 2019 16:50 — forked from pizycki/QuickStart.fs
MySQL, Dapper and F#
// Place this in .fsproj
// <ItemGroup>
// <PackageReference Include="Dapper.Contrib" Version="1.60.1" />
// <PackageReference Include="MySqlConnector" Version="0.56.0" />
// </ItemGroup>
open Dapper
open MySql.Data.MySqlClient
// CREATE TABLE `8833_rw_dev`.`Releases` (
@rainbyte
rainbyte / bluemix_kubernets.md
Last active September 20, 2017 17:55
bluemix kubernets tutorial

Procedimiento para usar contenedores en Bluemix via Kubernetes

  1. Instalar Bluemix console tool y Kubernetes kubectl.
  2. Preparar los plug-ins que vamos a necesitar para usar contenedores:
    bx plugin install container-registry -r Bluemix
    bx plugin install container-service -r Bluemix
    
  3. Iniciar sesión en Bluemix con nuestras credenciales:
@rainbyte
rainbyte / monads.md
Last active October 25, 2017 17:51
Some thoughts about monads

Monads Conceptually

Fundamental knowledge

Before talking about monads, we should review 3 concepts:

Functions

They appear in the form f :: a -> b, where :: indicates the type of f.

module Main where
import Control.Monad (forM, when)
import Data.Array.IArray ((!))
import qualified Data.Array.IArray as A
-- input
-- budget
-- parties
[CCode (cheader_filename = "qmlbind.h")]
namespace Qml {
[CCode (has_target = true)]
public delegate void Func();
[CCode (cname = "struct qmlbind_application",
cprefix = "qmlbind_application_",
free_function = "qmlbind_application_release",
;; Step 1
(defn fact1 [n]
(if (< n 2) 1 (* n (fact1 (- n 1)))))
(println (fact1 5))
;; Step 2
(def fact2
((fn [f]
@rainbyte
rainbyte / Base64.hs
Last active August 29, 2015 14:09 — forked from igstan/Base64.hs
module Base64 (encode) where
import Data.Bits (shiftL, shiftR, (.|.))
import Data.List (replicate)
import Data.Maybe (fromJust)
import Data.Word (Word8)
import Data.ByteString (ByteString, append, pack)
import qualified Data.ByteString as ByteString
import qualified Data.ByteString.Char8 as Char8
#include <stdio.h>
#include <stdlib.h>
#include "dricenter-lib.h"
int main(void)
{
struct dc_info *dc_info;
dc_init(dc_info);