Skip to content

Instantly share code, notes, and snippets.

View romac's full-sized avatar
🔮
λ

Romain Ruetschi romac

🔮
λ
View GitHub Profile
@romac
romac / Share.swift
Created January 30, 2024 09:16 — forked from mosen/Share.swift
Convenient swift-like wrapper over NetFS smb mounting
import Foundation
import NetFS
enum ShareMountError: Error {
case InvalidURL
case MountpointInaccessible
case InvalidMountOptions
}
@romac
romac / collate.rs
Created July 13, 2022 10:33 — forked from rust-play/playground.rs
Collate a sequence of ordered elements
use std::ops::{Add, RangeInclusive};
struct Collate<Iter, Item> {
iter: Iter,
current: Option<RangeInclusive<Item>>,
}
impl<Iter, Item> Collate<Iter, Item> {
fn new(iter: Iter) -> Self {
Self {
@romac
romac / robot.js
Created December 4, 2012 22:30 — forked from S3Mi/robot.js
Dupazaur
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
robot.rotateCannon(360);
robot.back(100);