Skip to content

Instantly share code, notes, and snippets.

@ityonemo
ityonemo / algebra.zig
Last active January 4, 2021 13:54
Strategy for composable Algebra in Zig
const std = @import("std");
pub fn Algebra(comptime fields: []const type) type {
return struct{
pub fn @"<+>"(a: anytype, b: anytype) FieldFor(@TypeOf(a), @TypeOf(b)).Type {
const F: type = FieldFor(@TypeOf(a), @TypeOf(b));
return F.@"<+>"(a, b);
}
pub fn FieldFor(comptime AType: type, comptime BType: type) type {
@ctran
ctran / check-slave-jar-version.groovy
Last active May 9, 2023 12:21
Check slave.jar versions of slaves against expected version on Jenkins master
import jenkins.model.*
import hudson.remoting.Launcher
import hudson.slaves.SlaveComputer
def expectedVersion = Launcher.VERSION
for (computer in Jenkins.instance.getComputers()) {
if (! (computer instanceof SlaveComputer)) continue
if (!computer.getChannel()) continue
def version = computer.getSlaveVersion()
@Martin91
Martin91 / track_original_repo.sh
Created July 2, 2013 12:37
Make Your Fork Track the Original Upstream Repo
git remote add --track master upstream git://github.com/upstreamname/projectname.git
git fetch upstream
git merge upstream/master