This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extern crate jni; | |
use aho_corasick::AhoCorasickBuilder; | |
use jni::objects::JClass; | |
use jni::objects::JList; | |
use jni::objects::JString; | |
use jni::sys::jint; | |
use jni::sys::jstring; | |
use jni::JNIEnv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
help: ## This help | |
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST) | sort | |
clean: ## Clean local environment | |
@find . -name "*.pyc" | xargs rm -rf | |
@find . -name "*.pyo" | xargs rm -rf | |
@find . -name "__pycache__" -type d | xargs rm -rf | |
@rm -f .coverage | |
@rm -rf htmlcov/ | |
@rm -f coverage.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns todo.handler | |
(:require [compojure.core :refer :all] | |
[compojure.handler :as handler] | |
[compojure.route :as route] | |
[ring.middleware.json :as json] | |
[ring.util.response :refer [response]] | |
[todo.query :refer :all])) | |
(defroutes app-routes | |
(GET "/api/todos" [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns todo.query | |
(:require [todo.database] | |
[korma.core :refer :all])) | |
(defentity items) | |
(defn get-todos [] | |
(select items)) | |
(defn add-todo [title description] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns todo.database | |
(:require [korma.db :as korma])) | |
(def db-connection-info | |
(korma/mysql | |
{:classname "com.mysql.jdbc.Driver" | |
:subprotocol "mysql" | |
:user "root" | |
:subname "//localhost:3306/todo"})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE DATABASE menagerie; | |
CREATE TABLE items ( | |
id MEDIUMINT NOT NULL AUTO_INCREMENT, | |
title varchar(255), | |
description varchar(255), | |
primary key (id) | |
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def pg (postgres ..)) | |
(def ms (mssql ..)) | |
(def msac (msaccess ..)) | |
(def orc (oracle ..)) | |
(def mys (mysql ..)) | |
(def sqll (sqlite3 ..)) | |
(def h2-db (h2 ..)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def pg (postgres ..)) | |
(def ms (mssql ..)) | |
(def msac (msaccess ..)) | |
(def orc (oracle ..)) | |
(def mys (mysql ..)) | |
(def sqll (sqlite3 ..)) | |
(def h2-db (h2 ..)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defproject todo "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:url "http://example.com/FIXME" | |
:min-lein-version "2.0.0" | |
:dependencies [[org.clojure/clojure "1.8.0"] | |
[compojure "1.5.1"] | |
[ring/ring-core "1.3.2"] | |
[ring/ring-json "0.3.1"] | |
[korma "0.3.0-RC5"] | |
[mysql/mysql-connector-java "5.1.6"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(System/getProperty "java.vm.version") |
NewerOlder