Skip to content

Instantly share code, notes, and snippets.

View zygisx's full-sized avatar

Žygimantas Gatelis zygisx

  • MobileLife
  • Vilnius, Lithuania
  • X @zygis_
View GitHub Profile
@cvogt
cvogt / gist:9239494
Last active September 9, 2019 01:30
Slick app architecture cheat sheet
// Please comment in case of typos or bugs
import scala.slick.driver.H2Driver._
val db = Database.for...(...)
case class Record( ... )
class Records(tag: Tag) extends Table[Record](tag,"RECORDS"){
...
def * = ... <> (Record.tupled,Record.unapply)
// place additional methods here which return values of type Column
@mconbere
mconbere / matrix.c
Created March 5, 2011 00:18
The main file that shows how to use the matrix class I built
#include "matrix.h"
#include <stdlib.h>
matrix_t *matrix_create(size_t width, size_t height) {
matrix_t *self = malloc(sizeof(matrix_t));
self->width = width;
self->height = height;
self->data = malloc(sizeof(void *) * width * height);
return self;