Skip to content

Instantly share code, notes, and snippets.

@bbarker
bbarker / claude-code
Created March 2, 2025 01:19
deno-claude
#!/usr/bin/env bash
export GOOGLE_SDK_NODE_LOGGING=1
exec deno run --allow-read --allow-net --no-config \
--unstable-node-globals --unstable-bare-node-builtins \
--allow-sys --allow-env \
--allow-write="$HOME/.claude" \
--allow-read="$HOME/.cache/deno,$HOME/.claude,$(pwd)" \
--lock /home/bbarker/.deno/bin/.claude-code.lock.json \
@bbarker
bbarker / rebase_squash.sh
Created November 22, 2024 14:05
A script to quickly squash together commits in your current branch
#!/usr/bin/env bash
# Function to check if we're in a Git repository
check_git_repo() {
if ! git rev-parse --is-inside-work-tree > /dev/null 2>&1; then
echo "Error: Not in a Git repository."
exit 1
fi
}
@bbarker
bbarker / upgrade_blog_ok.txt
Created November 21, 2024 23:53
upgrade blog ok
bblog-entries/main> project.create test-blog-upgrade
🎉 I've created the project test-blog-upgrade.
I'll now fetch the latest version of the base Unison library...
🎨 Type `ui` to explore this project's code in your browser.
🔭 Discover libraries at https://share.unison-lang.org
@bbarker
bbarker / OI_packaging_discussion.md
Last active November 12, 2023 18:31
OI packaging discussion 11/12/2023
  • https://repology.org/
    • doesn’t notify maintainers
    • provides a view of which packages are out of date
      • Till has a prototype that will bump versions “the forge” / activity pub
  • Docs - priority is to guide new people into the process of contributing in various ways process
  • OminoOS uses a patched version of illumos, including patches for linux branded zones
    • These apparently did not meet the requirements of getting upstreamed to illumos
  • Two diverging versions of IPS (with OI and OmniOS), but only two directories are a problem.
    • Dependency trees wouldn’t resolve
  • Rust version is on the backburner - as it was figured out what the slow issue was in IPS
@bbarker
bbarker / build.sbt
Created February 13, 2022 15:34
JitPack Resolvers in SBT
resolvers ++= Seq(
"jitpack.io" at "https://jitpack.io/",
),
@bbarker
bbarker / build.sbt
Created February 13, 2022 15:33
Jitpack dependency in SBT
"io.github.bbarker" %% "zio-diffx" % "0.0.4" % Test
@bbarker
bbarker / Example3h.java
Last active December 12, 2021 05:21
This example has the same result in Scala 2, though in Java there is one difference that relates to the fact that Java (unlike Scala) does not support declaration-site variance
ArrayList<JavaBean<Object>> beanList1 = new ArrayList(Arrays.asList(bean1, bean2, bean3));
public <A> void polySetAllBeansToFirst(List<JavaBean<A>> beanList) {
beanList.forEach((bean) -> bean.setTheA(beanList.get(0).getTheA()));
}
polySetAllBeansToFirst(beanList1);
// ^ We can't do this in Scala, because we can't even construct beanList1
@bbarker
bbarker / Example3g.scala
Created December 12, 2021 05:02
let's try and be slightly more clever and use an element contained in the list
def exSetAllBeansToFirst(beanList: List[ScalaBean[?]]): Unit =
val firstBean = beanList.head // bad: don't use head if the list may be empty
beanList.foreach{bean =>
bean.setTheA(firstBean.getTheA)
// ❌ Found: firstBean.A
// Required: bean.A
}
@bbarker
bbarker / Example3f.scala
Created December 12, 2021 05:00
Scala won't even let us try it (good!)
def exSetAllBeansTo(beanList: List[ScalaBean[?]], initBean: ScalaBean[?]): Unit =
beanList.foreach{bean =>
bean.setTheA(initBean.getTheA)
// ❌ Found: initBean.A
// Required: bean.A
}
@bbarker
bbarker / Example3e.scala
Created December 12, 2021 04:57
try to set values. Let's try making such a function
def polySetAllBeansTo[A](beanList: List[ScalaBean[A]], initBean: ScalaBean[A]): Unit =
beanList.foreach{bean =>
bean.setTheA(initBean.getTheA)
}
polySetAllBeansTo(beanList3, bean1)
// everything is now set to bean1's value
println(beanList2.map(_.getTheA))
polySetAllBeansTo(beanList2, bean1)