Skip to content

Instantly share code, notes, and snippets.


Commands on Linux to gather information related to GPUs

Below is a list of commands and resources that work on Linux (some need installation of packages), would love to welcome contributions for the same for MacOSX and Windows platforms too. Please share and contribute back.

Please run the below in both vagrant, docker and other container environments and share your experiences with us!

About me:, my blogs:

Get Hardware Details
densh / Snake.scala
Last active Apr 14, 2020
Snake game in 200 lines of Scala Native and SDL2 as demoed during Scala Matsuri 2017
View Snake.scala
import scalanative.native._
import SDL._
import SDLExtra._
object SDL {
type Window = CStruct0
type Renderer = CStruct0
PerWiklander / ItemSelector.scala
Created Jun 24, 2015
Traits to simplify making scalajs-react widgets
View ItemSelector.scala
import scalaz.effect.IO
trait ItemSelector[ItemType] extends StatefulWidget[
override def initialState = P => ItemSelectorState(P.selected)
case class ItemSelectorProps[ItemType](
petemcw /
Last active Nov 15, 2021
Setup dnsmasq on Mac OS X
# Install `dnsmasq` and configure for *.test domains
$ brew install dnsmasq
$ vim /usr/local/etc/dnsmasq.conf
# Reload configuration and clear cache
$ sudo launchctl unload /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ sudo launchctl load /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plist
$ dscacheutil -flushcache
arturaz / gist:5007515
Created Feb 21, 2013
Serialising case class with Either to JSON in play framework 2.1 scala
View gist:5007515
package models
import play.api.libs.json._
import play.api.libs.json.Json._
import play.api.libs.functional.syntax._
import org.apache.commons.codec.binary.Base64
* Created with IntelliJ IDEA.
* User: arturas
dvanhorn / memo-dyn.txt
Created Aug 24, 2012
Memoization vs dynamic programming
View memo-dyn.txt
Memoization is fundamentally a top-down computation and dynamic
programming is fundamentally bottom-up. In memoization, we observe
that a computational *tree* can actually be represented as a
computational *DAG* (the single most underrated data structure in
computer science); we then use a black-box to turn the tree into a
DAG. But it allows the top-down description of the problem to remain
In dynamic programming, we make the same observation, but construct
the DAG from the bottom-up. That means we have to rewrite the
virtualirfan / latency.txt
Created Aug 4, 2012 — forked from h2oai/latency.txt
Latency numbers every programmer should know
View latency.txt
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 4K randomly from SSD 150,000 ns 0.15 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
conikeec / EsperUtil.scala
Created Feb 12, 2012 — forked from wangzaixiang/EsperUtil.scala
Using Esper with Scala
View EsperUtil.scala
package demo1
import com.espertech.esper.client.EventBean
import com.espertech.esper.client.EPAdministrator
import com.espertech.esper.client.UpdateListener
import com.espertech.esper.client.EPListenable
import com.espertech.esper.client.EPServiceProvider
object EsperUtil {