Skip to content

Instantly share code, notes, and snippets.

View carlosedp's full-sized avatar

Carlos Eduardo carlosedp

View GitHub Profile
@carlosedp
carlosedp / PipelineOps.scala
Last active January 23, 2023 12:42
Pipeline operators in Scala
#!/usr/bin/env -S scala-cli shebang
//> using scala "3"
/** Test functions */
val triple = (x: Int) => 3 * x
val half = (x: Int) => x / 2
val sum = (x: Int) => (y: Int) => x + y
/** with extension infix */
// extension [A, B](a: A)
@carlosedp
carlosedp / MemMask.scala
Last active November 8, 2022 21:16
MemoryMask-Circt+Firtool
//> using scala "2.13.8"
//> using lib "edu.berkeley.cs::chisel3::3.5.4"
//> using lib "com.sifive::chisel-circt::0.6.0"
//> using plugin "edu.berkeley.cs:::chisel3-plugin::3.5.4"
//> using options "-unchecked", "-deprecation", "-language:reflectiveCalls", "-feature", "-Xcheckinit", "-Xfatal-warnings", "-Ywarn-dead-code", "-P:chiselplugin:genBundleElements", "-Ywarn-unused"
import chisel3._
import circt.stage.ChiselStage
import chisel3.stage.ChiselGeneratorAnnotation
@carlosedp
carlosedp / ChiselArgs.scala
Last active November 2, 2022 17:22
Chisel + Circt test with args
//> using scala "2.13.8"
//> using lib "edu.berkeley.cs::chisel3::3.5.4"
//> using lib "com.sifive::chisel-circt::0.6.0"
//> using plugin "edu.berkeley.cs:::chisel3-plugin::3.5.4"
import chisel3._
import circt.stage.ChiselStage
import chisel3.stage.ChiselGeneratorAnnotation
class FooBundle extends Bundle {
# Description: Boxstarter Script
# Author: CarlosEDP
#
# First set: Set-ExecutionPolicy RemoteSigned
#
# Install boxstarter:
# . { iwr -useb https://boxstarter.org/bootstrapper.ps1 } | iex; Get-Boxstarter -Force
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
# start http://boxstarter.org/package/nr/url?https://github.com/carlosedp/dotfiles/raw/master/boxstarter.ps1
/** SemVer bump mode type
*/
object BumpMode extends Enumeration {
type Mode = Value
val Major, Minor, Patch, None = Value
}
object SemVer {
/** Creates a new [[SemVer]] with bump and manipulation
*
@carlosedp
carlosedp / el_docker.py
Created September 13, 2022 20:13
Edalize Launcher script for containers
#!/usr/bin/python3
import os
import shutil
import subprocess
import sys
import logging
import shlex
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("EdalizeLauncher")
@carlosedp
carlosedp / Readme.md
Last active September 5, 2022 19:52
Scala Mill build file for ScalaScripts

Scala Mill build.sc file for Scala Scripts

This build file defines a ScalaScript trait that can be used to build Scala Scripts.

The trait adds some methods to the build process:

  • run to execute the script
  • test to call a matching script test file in the pattern scriptname.test.scala
  • native to build a native image using GraalVM in the same dir. The binary is compressed with UPX.
@carlosedp
carlosedp / Readme.md
Last active May 3, 2023 19:13
Find plugin updates for Scala cli, mill build tool and ammonite scripts

This is a Scala script to check for Mill build plugin and scala-cli lib updates. The plugin requires scala-cli.

Run directly from the gist with:

scala-cli https://gist.github.com/carlosedp/c3ea2814ac5392051a562e95c1298239/raw/checkdeps.sc

Or download the script, make it executable and run as:

@carlosedp
carlosedp / minio-template.yaml
Last active September 11, 2025 17:58
Min.io OpenShift template
# This file is a template for deploying Minio on OpenShift.
# The template is stored at https://gist.github.com/carlosedp/703bf3cae3715ac0fb677499550be295
#
# To create a Minio deployment using Docker/Podman, use:
# mkdir -p ~/minio/data
#
# podman run \
# -p 9000:9000 \
# -p 9001:9001 \
# -v ~/minio/data:/data \
@carlosedp
carlosedp / _mill
Last active July 19, 2022 20:15
Scala mill build tool Zsh completion script
#compdef mill
# Install this file somewhere in your $FPATH (Zsh completion path)
# shellcheck disable=SC2207
__mill_debug()
{
# To enable debug, export in the shell the BASH_COMP_DEBUG_FILE variable to a file.
# Eg. BASH_COMP_DEBUG_FILE="/tmp/mill_debug.txt"