Skip to content

Instantly share code, notes, and snippets.

@neomatrix369
neomatrix369 / know-your-gpus.md
Last active July 10, 2024 18:52
Know your GPUs

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: http://neomatrix369.wordpress.com/about, my blogs: http://neomatrix369.wordpress.com/

Get Hardware Details
@densh
densh / Snake.scala
Last active August 26, 2024 06:29
Snake game in 200 lines of Scala Native and SDL2 as demoed during Scala Matsuri 2017
import scalanative.native._
import SDL._
import SDLExtra._
@extern
@link("SDL2")
object SDL {
type Window = CStruct0
type Renderer = CStruct0
@PerWiklander
PerWiklander / ItemSelector.scala
Created June 24, 2015 19:59
Traits to simplify making scalajs-react widgets
import scalaz.effect.IO
trait ItemSelector[ItemType] extends StatefulWidget[
ItemSelectorProps[ItemType],
ItemSelectorState[ItemType]
]
{
override def initialState = P => ItemSelectorState(P.selected)
}
case class ItemSelectorProps[ItemType](
@petemcw
petemcw / brew-instructions.sh
Last active March 27, 2024 15:59
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
arturaz / gist:5007515
Created February 21, 2013 19:41
Serialising case class with Either to JSON in play framework 2.1 scala
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
dvanhorn / memo-dyn.txt
Created August 24, 2012 17:53
Memoization vs dynamic programming
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
unchanged.
In dynamic programming, we make the same observation, but construct
the DAG from the bottom-up. That means we have to rewrite the
@virtualirfan
virtualirfan / latency.txt
Created August 4, 2012 22:07 — forked from h2oai/latency.txt
Latency numbers every programmer should know
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
conikeec / EsperUtil.scala
Created February 12, 2012 08:06 — forked from wangzaixiang/EsperUtil.scala
Using Esper with 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 {