Skip to content

Instantly share code, notes, and snippets.

@shajra-cs
shajra-cs / nixos.log
Last active September 28, 2016 02:36
trying to prune a fat cudatools to a thin one
/nix/store/y7za3xlznzizw8dlrsg5f3yibyr85z62-cudatoolkit-min-deeplab # strings -f nvvm/bin/cicc | grep cudatoolkit-7.0.28
nvvm/bin/cicc: /nix/store/2r9mk9qsrz8j0sjcbi1w03xwf78gf8km-ncurses-5.9/lib:/nix/store/gfblzhm3xxcnlyn1nl4jbr8bgjqbisli-expat-2.1.0/lib:/nix/store/hafq4v9hhmqkrs3gshaiipzynifrlgl0-python-2.7.11/lib:/nix/store/m4fx2ci32kxngwchy6cm5i1l5hjwv61f-zlib-1.2.8/lib:/nix/store/m4pc42smnk82sll24i3r7mpndar32pv2-glibc-2.21/lib:/nix/store/s9w68p09yrlhwqfnrv0bp6b8793hci5p-libX11-1.6.3/lib:/nix/store/2lhbibd7nmc538bhqx39hlax64brxq68-libXext-1.3.3/lib:/nix/store/1cd2liw5zdqdjfvdz719ry1lng951vyz-libXrender-0.9.9/lib:/nix/store/gz7bgdjj43mqxgbdcyvkb12md8vnf8jl-libXt-1.1.5/lib:/nix/store/r9lqbbf83a7pxy4nshqai529my96sgfs-libXtst-1.2.2/lib:/nix/store/2bin11pz6rynrqxk43l1xv62m39vj8fy-libXi-1.7.4/lib:/nix/store/2lhbibd7nmc538bhqx39hlax64brxq68-libXext-1.3.3/lib:/nix/store/hjlhzgcpahshk0qsiqx1z5w42s0r57s4-gtk+-2.24.28/lib:/nix/store/0fkybsbgp3vhmczncl91la5j59pa7k8b-glib-2.44.1/lib:/nix/store/ldvirfxz2n1lhdb5n7y69v
@shajra-cs
shajra-cs / builder.sh
Created August 12, 2016 06:31
code review of a download derivation
source "$stdenv/setup"
curl \
--insecure \
--retry 3 \
--netrc-file "$netrc" \
"$url" > "$out"
@shajra-cs
shajra-cs / refactored.scala
Created November 5, 2015 16:23
a refactoring of some work Steve is looking at
import scalaz.syntax.either._
import scalaz.syntax.optional._
def executeUpsertEntity(request: UpsertEntityRequest)
: ErrResponse \/ UpsertEntityResponse =
for {
cleanRequest <- validateUpsertRequestValues(request)
validKey <- validateCompositeKey(cleanRequest.keyValues)
result <- executeUpsert(validKey, cleanRequst)
@shajra-cs
shajra-cs / gist:2ede3deed934ea9981d4
Created October 22, 2015 03:51
Scalac's using a partial function. . .
java.lang.UnsupportedOperationException: tail of empty list
at scala.collection.immutable.Nil$.tail(List.scala:339)
at scala.collection.immutable.Nil$.tail(List.scala:334)
at scala.reflect.internal.SymbolTable.popPhase(SymbolTable.scala:172)
at scala.reflect.internal.pickling.UnPickler$Scan$LazyTypeRef.complete(UnPickler.scala:856)
at scala.reflect.internal.Symbols$Symbol.info(Symbols.scala:1231)
at scala.reflect.internal.Symbols$Symbol.initialize(Symbols.scala:1374)
at scala.reflect.internal.Symbols$Symbol.hasFlag(Symbols.scala:607)
at scala.reflect.internal.Symbols$Symbol.isStatic(Symbols.scala:804)
at scala.reflect.runtime.JavaMirrors$JavaMirror.reflectModule(JavaMirrors.scala:198)
@shajra-cs
shajra-cs / Syntax.scala
Created October 7, 2015 05:21
A clever use of unapply to get syntax on Scalaz process for error handling
package shajra.extn.scalaz.stream
import scalaz.{ Bind, Traverse, Unapply }
import scalaz.stream.Process
trait Syntax {
implicit class ProcessSyntax[F[_], A](self: Process[F, A]) {
@shajra-cs
shajra-cs / example.scala
Created September 28, 2015 00:35
Here's an example of a tutorial that spun out of a Friday discussion.
package c12e.learn
// Note, expressions in Scala need to be inside things like objects. We'll
// discuss objects (and packages) later. These are just a complications we
// introduce now to have a well-formed program.
object ValuesAndTypes {
// Binding Values