Skip to content

Instantly share code, notes, and snippets.

@felixflores
felixflores / gist:2ce479ae9f0b6e90a913
Last active August 29, 2015 14:15
Clojure Database Manipulation and Migration with Drift and SQLingvo

Overview

To create any non-trivial application, you need some way of persisting data. While there are a lot solutions available, Datomic, Neo4j, Samza, just to name a few, but for various reasons, a lot of us still use relational databases. One reason might be because there is a pre-existing Rails application that still needs to interoperate with the Clojure application you are building. Another reason could be because of the exisiting deployment environment requires you to use a certain type of database (I encountered this first hand while working for a large client).

+--------------+          +---------------+
|              |          |               |
|     Ruby     |          |               |
|      on      |          |   Compojure   |
|     Rails    |          | (Clojure app) |
@felixflores
felixflores / gist:7127eb73ddeb126900fc
Last active July 21, 2017 14:47
My Spacemacs Config
;; -*- mode: emacs-lisp -*-
;; This file is loaded by Spacemacs at startup.
;; It must be stored in your home directory.
(defun dotspacemacs/layers ()
"Configuration Layers declaration.
You should not put any user code in this function besides modifying the variable
values."
(setq-default
;; Base distribution to use. This is a layer contained in the directory
@felixflores
felixflores / as_sql_models_sample.rb
Last active March 16, 2017 04:09
Sample Data for ActiveRecord Problem
class Student < ActiveRecord::Base
has_many :assignments
end
class Assignment < ActiveRecord::Base
belongs_to :student
end
students table
id name
1 Felix
2 John
3 Bob
assignments table
id student_id number status