Skip to content

Instantly share code, notes, and snippets.

View ruliana's full-sized avatar

Ronie Uliana ruliana

View GitHub Profile
@ruliana
ruliana / run_container.sh
Created February 11, 2025 13:34
Script to run an interactive shell from Stanford's XCS236 Docker image using Docker
#!/bin/bash
# Check if the container image already exists
if docker image inspect xcs236-env >/dev/null 2>&1; then
echo "Container image already exists. Skipping build."
else
# Build the container
echo "Building container..."
docker build -t xcs236-env .
fi
@ruliana
ruliana / run_container.sh
Last active February 11, 2025 13:29
Script to run an interactive shell from Stanford's XCS236 Docker image using Podman
#!/bin/bash
# Company file for XCS236 Docker image
# https://gist.github.com/ruliana/50e8e751ae0dc6af2a6b08d08bf2a027
# Check if the container image already exists
if podman image exists xcs236-env; then
echo "Container image already exists. Skipping build."
else
# Build the container
@ruliana
ruliana / Dockerfile
Created February 11, 2025 13:22
Dockerfile to build an environment compatible with Stanford's XCS236 from 2025
# Use Miniconda as base image
FROM continuumio/miniconda3
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
zsh \
curl \
&& rm -rf /var/lib/apt/lists/*
@ruliana
ruliana / pytorch_geometric_install.ipynb
Last active October 24, 2024 13:20
How to install PyTorch Geometric and dependencies in Google Colab
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ruliana
ruliana / FIN-load-from-url.lua
Last active August 13, 2023 03:55
Lua script for loading and executing files from URLs in FICSIT Network
-- All the scripts that should be loaded.
-- Put then in load order
local URLs = {
"https://gist.githubusercontent.com/ruliana/b48dcbaa1ddd92882e9a3cca36d6777f/raw/819bb7ebbd530a1d94601549fd6ae819ecea1cf4/FIN-item-flow-measurement.lua"
}
local card = computer.getPCIDevices(findClass("FINInternetCard"))[1]
if not card then
error("Internet card not found")
end
@ruliana
ruliana / FIN-item-flow-measurement.lua
Last active August 17, 2023 01:16
Lua script for print in a screen the belt throughput in FICSIT Network
---------------------
----- UTILITIES -----
---------------------
-- Utilities to get components from the network
function getComponents(className)
local compos = component.proxy(component.findComponent(findClass(className)))
if #compos == 0 then
error(string.format("No component of class \"%s\" found", className))
end
@ruliana
ruliana / xslt-pseudo.el
Created June 18, 2023 09:04
XSLT Pseudo Implementation in Elisp
(defun apply-templates (node templates)
(let (output)
;; loop through each template
(dolist (template templates output)
;; if the current node matches the template
(when (matches node (car template))
;; apply the template and stop processing further templates
(setq output (apply-template node template))
(return output)))
;; if no template matched, process the node's children
@ruliana
ruliana / builder-function.rkt
Created October 9, 2021 16:40
Functional design patterns - builder function (Racket)
(define ((builder builder-param other-builder-param) trivial-param)
; ... do stuff
something)
@ruliana
ruliana / builder-function.rkt
Last active October 11, 2021 09:03
Functional design patterns - builder function (Racket)
(define (builder builder-param other-builder-param)
; ... optionally some initialization code
(λ (trivial-param)
; ... do stuff
something))
@ruliana
ruliana / builder_function.py
Last active October 11, 2021 09:05
Functional design patterns - builder function (Python)
def builder(builder_param, other_builder_param):
# ... optionally some initialization code
def the_actual_function(trivial_param):
# ... do stuff
return something
return the_actual_function
# Then later...
my_func = builder(x, y)