Skip to content

Instantly share code, notes, and snippets.

Using Torch in Atom

Install Atom from https://atom.io or with brew cask install atom

Then install packages (example apm install hydrogen, apm is a package manager for atom):

  • hydrogen
  • autocomplete-paths
  • language-lua
@djspiewak
djspiewak / streams-tutorial.md
Created March 22, 2015 19:55
Introduction to scalaz-stream

Introduction to scalaz-stream

Every application ever written can be viewed as some sort of transformation on data. Data can come from different sources, such as a network or a file or user input or the Large Hadron Collider. It can come from many sources all at once to be merged and aggregated in interesting ways, and it can be produced into many different output sinks, such as a network or files or graphical user interfaces. You might produce your output all at once, as a big data dump at the end of the world (right before your program shuts down), or you might produce it more incrementally. Every application fits into this model.

The scalaz-stream project is an attempt to make it easy to construct, test and scale programs that fit within this model (which is to say, everything). It does this by providing an abstraction around a "stream" of data, which is really just this notion of some number of data being sequentially pulled out of some unspecified data source. On top of this abstraction, sca

@staltz
staltz / introrx.md
Last active May 10, 2024 12:08
The introduction to Reactive Programming you've been missing
@dkandalov
dkandalov / plugin.groovy
Last active December 23, 2015 13:39
Mini-plugin for IntelliJ to move current tab left/right with splitting. This code can be executed using this plugin https://github.com/dkandalov/live-plugin
import com.intellij.openapi.actionSystem.ActionManager
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.actionSystem.DataContext
import com.intellij.openapi.actionSystem.IdeActions
import com.intellij.openapi.fileEditor.ex.FileEditorManagerEx
import com.intellij.openapi.project.Project
import org.jetbrains.annotations.NonNls
import javax.swing.SwingConstants
  • Setup Database
create database [db-name];
revoke all on schema public from public;
create schema [schema-name];
create table [schema-name].[table-name](
  ...
) 
@retronym
retronym / type-bounds.scala
Created December 16, 2009 11:17
Tour of Scala Type Bounds
class A
class A2 extends A
class B
trait M[X]
//
// Upper Type Bound
//
def upperTypeBound[AA <: A](x: AA): A = x