Skip to content

Instantly share code, notes, and snippets.

View weaver-viii's full-sized avatar
🤳
selfie chika!!

Roma Chi weaver-viii

🤳
selfie chika!!
  • Earth
View GitHub Profile
@weaver-viii
weaver-viii / OOCheatSheet.java
Created January 14, 2021 09:36 — forked from john-science/OOCheatSheet.java
Java: an Objected Oriented Cheat Sheet
/**
* The basic class syntax.
*/
public class BasicClass {
public BasicClass() {
// This is the constructor.
}
@weaver-viii
weaver-viii / hibernate-clojure.clj
Created July 4, 2016 09:00 — forked from m0smith/hibernate-clojure.clj
Proof of concept of using clojure and hibernate
(ns topoged.model.type
(:import
(javax.persistence Entity Id Column Table GeneratedValue)
))
(definterface IType (getId []))
(deftype
^{Entity {} Table {:name="TYPE"} org.hibernate.annotations.Entity {:mutable false}}
TypeX [^Long id]
@weaver-viii
weaver-viii / default-openshift-ghost.vcl
Created June 25, 2016 16:40 — forked from niedbalski/default-openshift-ghost.vcl
Proxy varnish ghost blog engine on redhat openshift
backend default {
.host = "app.rhcloud.com";
.port = "80";
}
sub vcl_recv {
set req.http.host = "app.rhcloud.com";
if (req.http.cache-control ~ "no-cache") {
@weaver-viii
weaver-viii / README.rst
Created April 10, 2016 15:23 — forked from njwilson/README.rst
Machine Learning Throwdown

Services and Algorithms

This section describes each of the services compared in the throwdown and the algorithms/models used.

BigML

Decision trees.

Services and Algorithms

This section describes each of the services compared in the throwdown and the algorithms/models used.

BigML

Decision trees, both single and bagged.

@weaver-viii
weaver-viii / introrx.md
Created March 21, 2016 01:48 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing
@weaver-viii
weaver-viii / dev.clj
Created November 25, 2015 15:00 — forked from paulosuzart/dev.clj
This shows how to use custom immutant init functions to load arbitrary files according to the environment the app is running. This uses a combination of: leiningen profiles + custom immutant init function + clojure's ability to evaluate scripts + some magical stuff with namespaces.
(defn handler
[r] ((build-routes) r))
(web/start handler
:reload true)
(msg/start "/queue/delivery.status")
(msg/respond "/queue/delivery.status" handle-delivery-status)
@weaver-viii
weaver-viii / gist:c46578dbeaf84e235590
Created October 13, 2015 16:24 — forked from a2ndrade/gist:5820364
Datomic: nested component entities
;; see http://stackoverflow.com/questions/16242750/nesting-structures-with-datomic
(require '[datomic.api :as d])
(def uri "datomic:mem://test")
(d/create-database uri)
(def conn (d/connect uri))
;; sample attributes
(d/transact conn [{:db/id #db/id[:db.part/db]
:db/ident :some/ref-value
:db/valueType :db.type/ref
@weaver-viii
weaver-viii / gist:7682333af2c902d1d5ce
Created October 13, 2015 16:23 — forked from a2ndrade/gist:5814355
Datomic: Getting the id of an inserted entity
;; see http://stackoverflow.com/questions/17190334/getting-the-id-of-an-inserted-entity-in-diatomic
(require '[datomic.api :as d])
(def uri "datomic:mem://test")
(d/create-database uri)
(def conn (d/connect uri))
;; create an atribute
(d/transact conn [{:db/id #db/id[:db.part/db]
:db/ident :some/attribute
:db/valueType :db.type/string
@weaver-viii
weaver-viii / gist:f746ec60acd0a71c4b2a
Created October 7, 2015 17:24 — forked from a2ndrade/gist:5655005
Datomic: containment relationships i.e. db/isComponent
(require '[datomic.api :as d])
(def uri "datomic:mem://test")
(d/create-database uri)
(def conn (d/connect uri))
(d/transact conn [;; Article
{:db/id #db/id [:db.part/db]
:db/ident :article/title
:db/valueType :db.type/string
:db/cardinality :db.cardinality/one