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
(defn edit-buttons [_ _ {:keys [ch>]}] | |
(reify | |
om/IRender | |
(render [_] | |
(dom/div #js {:className "form-group btn-group" | |
:style (js-margin-right)} | |
(dom/button #js {:className "btn btn-default" | |
:onClick (fn [e] | |
(.preventDefault e) | |
(put! ch> {:event e |
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
(defroutes rotas | |
#_(ANY "/empresa" [] | |
(resource | |
:available-media-types ["application/edn"] | |
:method-allowed? (request-method-in :get :post) | |
:handle-ok (fn [ctx] | |
(k/select ent/empresa (k/fields :id :nome))) | |
:post! (fn [ctx] | |
(let [empresa (read-edn-from-body ctx)] | |
{::result (insert-empresa empresa)})) |
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 util.map | |
(:require [schema.core :as s] | |
[clojure.set :as set] | |
[clojure.data :refer [diff]] | |
[clojure.pprint :refer [pprint]])) | |
(s/def TAnyMap {s/Any s/Any}) | |
(s/defn diff-by-key :- [(s/one TAnyMap "included") | |
(s/one TAnyMap "excluded") |
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 manutencao.core | |
(:require [brutha.core :as br] | |
[flupot.dom :as dom])) | |
(def state (atom {:some-context {:client {:name "geraldo"}}})) | |
(def input-widget | |
(br/component | |
(fn [[value ks]] | |
(dom/input {:value value |
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 manutencao "0.1.0-SNAPSHOT" | |
:description "FIXME: write this!" | |
:url "http://example.com/FIXME" | |
:jvm-opts ["-Xmx2048m"] | |
:dependencies [ | |
[buddy "0.5.3"] | |
[clj-time "0.9.0"] | |
[com.rpl/specter "0.5.0"] | |
[com.stuartsierra/component "0.2.3"] | |
[cuerdas "0.3.2"] |
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
# encoding: utf-8 | |
require "rubygems" | |
require "jdbc/postgres" | |
require "java" | |
require "metadata" | |
require "fileutils" | |
require "stringio" | |
require "tree" | |
require "builder" | |
require "pathname" |
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
(defn vector-map-zipper [m] | |
(letfn [(map?-or-persistent-vector? [x] | |
(or (map? x) | |
(instance? clojure.lang.PersistentVector x)))] | |
(let [filter-map-or-pv (filter (comp map?-or-persistent-vector? #(nth % 1)))] | |
(zip/zipper | |
(fn [x] (or (map?-or-persistent-vector? x) | |
(and (instance? clojure.lang.MapEntry x) | |
(map?-or-persistent-vector? (nth x 1))))) |
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
(defn exporta-trans-sqlite [db diretorio empresa] | |
(with-open [dbf (org.xBaseJ.DBF. (nome-dbf diretorio trans-base empresa) "r")] | |
(let [field-keys [:funcc :data :tipo :fdeptoant :fdeptonov] | |
fields (apply xbase/keys-to-fields-vec dbf field-keys) | |
n-registros (.getRecordCount dbf) | |
] | |
(println "exportando " (.getName dbf) " para o sqlite") | |
;; (jdbc/execute! db ["PRAGMA synchronous = OFF"]) | |
(jdbc/execute! db ["drop table if exists trans"]) | |
(jdbc/execute! db ["create table trans |
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
219c219,220 | |
< 'save': {method:'POST'}, | |
--- | |
> 'create': {method:'POST'}, | |
> 'update': {method:'PUT'}, | |
421a423,431 | |
> | |
> Resource.prototype.$save = function(a1, a2, a3) { | |
> if (this.id) { | |
> Resource.prototype.$update.call(this, a1, a2, a3); |
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
(:require | |
[clojure.pprint :refer [pprint]] | |
[clojure.stacktrace :refer :all] | |
[clojure.tools.namespace.repl :refer (refresh refresh-all disable-reload!)] | |
[figwheel-sidecar.config :as figcfg] | |
[figwheel-sidecar.repl-api :refer :all] | |
[leiningen.core.project :as proj] | |
[cemerick.piggieback :as piggieback] | |
)) |
OlderNewer