Skip to content

Instantly share code, notes, and snippets.

@shajra
shajra / nix-store.log
Created September 3, 2014 21:03
Why isn't nix-store working here?
shajra bagel /nix/var/nix/profiles
$ readlink -f /nix/var/nix/profiles/chroot/bin/bash
/nix/store/q5wfq0i6w4p6a7155p4hia6p3n8rk7aq-bash-4.2-p47/bin/bash
shajra bagel /nix/var/nix/profiles
$ nix-store -qR /nix/var/nix/profiles/chroot/bin/bash
error: path ‘/nix/var/nix/profiles/chroot/bin/bash’ is not in the Nix store
@shajra
shajra / nix_log.txt
Last active August 29, 2015 14:06
How do two different derivations have the same roots?
shajra bagel ~
$ nix-store -q --roots /nix/store/zr69y5131gwh9jjfpmrdbn17l30xm47v-bash42-028.drv | cat
cannot read potential root ‘/nix/var/nix/manifests’
/nix/var/nix/profiles/chroot-13-link
/nix/var/nix/profiles/default-10-link
/nix/var/nix/profiles/per-user/shajra/default-8-link
shajra bagel ~
$ nix-store -q --roots /nix/store/yarb0fn7xgrby4a00q1r1iys2i3rl7sv-bash42-030.drv | cat
cannot read potential root ‘/nix/var/nix/manifests’
@shajra
shajra / invitation.md
Last active August 29, 2015 14:07
an open invitation

If you're interested in making great software by discovering the deeper truth of logic and abstraction, then this is an open invitation for your participation in our community. Unfortunately, most software communities are notoriously imbalanced, creating needless hurdles for people of various gender identities, races, religions, political groups, sexual orientation, and disabled communities (to name a few). Such exclusion services no one's best interest. So, we want to actively call for participation from anyone interested in making our software better.

We guarantee a safe environment where we promote well-reasoned arguments that lead to the greatest software we can possibly make. Unfortunately, along the way someone may make an error, or worse yet, exercise malice. We'll work hard towards keeping conversations objective and inclusive. Sometimes it's tough work, but we're completely invested in the process. If you feel a public forum has not served you well, please contact us privately so we have a ch

package actionstat.extn.pirate
import io.mth.pirate.Flag
import io.mth.pirate.Flag._
import scalaz.Isomorphism.{<=>, Iso}
@shajra
shajra / IdOps.scala
Created November 5, 2014 01:20
Is this idea for a Phantom-like operator reasonable?
implicit class IdOps[A](a: A) {
def callNullable[B](f: A => B): Maybe[B] =
if (a != null) {
val b = f(a)
if (b != null) Maybe.just(b) else Maybe.empty
} else Maybe.empty
def ?>[B](f: A => B): Maybe[B] = callNullable(f)
@shajra
shajra / Result.scala
Last active August 29, 2015 14:09
an idea for error handling in scalaz-stream
package myorg.extn.scalaz.stream
sealed abstract class Result[E, O] {
def fold[A]
(cont: O => A, done: => A, failCont: E => A, failStop: E => A) =
this match {
case Cont(o) => cont(o)
case Done() => done
case FailCont(e) => failCont(e)
@shajra
shajra / 1.syntax.scala
Last active August 29, 2015 14:09
Took a while to get Unapply working. . . very open to some code review
case class ProcessMSyntax[F[_], MM[_], A]
(self: Process[F, MM[A]], trav: Traverse[MM]) {
def throughM[MB]
(c: Channel[F, A, MB])
(implicit
uBindB: Unapply[Bind, MB] { type M[X] = MM[X] })
: Process[F, uBindB.M[uBindB.A]] = {
val substC = uBindB.leibniz.subst[Channel[F, A, ?]](c)
ProcessFunctions.throughChannelM(self, substC)(uBindB.TC, trav)
@shajra
shajra / ParseOpts.scala
Last active August 29, 2015 14:10
illustration of my usage of scala-optparse-applicative
package actionstat.builtwith.load
package config
import java.io.File
import java.lang.String
import scala.{ StringContext, Unit }
import scala.collection.immutable.List
@shajra
shajra / oo_vs_fp.response.md
Last active August 29, 2015 14:10
response to Bob Martin's "OO vs FP" post

A Response to a Response

Bob Martin wrote a blog article titled "OO vs FP".

Bob has a style of writing that makes it hard for some to see clearly his position objectively. In fact, his post is itself a response to a slide from another presentation arguably suffering from the same qualities.

@shajra
shajra / scala.getting_started.md
Last active August 29, 2015 14:10
Getting started with Scala using SBT

If you don't know much about Scala, but want to get started quickly. It's by no means an guide to Scala or SBT, the build system for Scala I'm recommending for getting started. There's a learning curve to picking up both Scala and SBT. All I'd like to do is remove the barrier to entry, so you can begin your study.

I'm going to assume you've done some programming in some other language, but not necessarily work on the Java virtual machine (JVM), which Scala targets.

I'm also going to assume you have a Java Developer Kit (JDK) already installed