Skip to content

Instantly share code, notes, and snippets.

@linuxsoares
linuxsoares / rust-match.rs
Created January 6, 2023 13:17
Matcher text java x rust
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;
@linuxsoares
linuxsoares / Makefile
Created February 19, 2019 17:37
Crawler para pegar dados da ANAC
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
(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" []
(ns todo.query
(:require [todo.database]
[korma.core :refer :all]))
(defentity items)
(defn get-todos []
(select items))
(defn add-todo [title description]
(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"}))
CREATE DATABASE menagerie;
CREATE TABLE items (
id MEDIUMINT NOT NULL AUTO_INCREMENT,
title varchar(255),
description varchar(255),
primary key (id)
);
(def pg (postgres ..))
(def ms (mssql ..))
(def msac (msaccess ..))
(def orc (oracle ..))
(def mys (mysql ..))
(def sqll (sqlite3 ..))
(def h2-db (h2 ..))
(def pg (postgres ..))
(def ms (mssql ..))
(def msac (msaccess ..))
(def orc (oracle ..))
(def mys (mysql ..))
(def sqll (sqlite3 ..))
(def h2-db (h2 ..))
(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"]
(System/getProperty "java.vm.version")