Skip to content

Instantly share code, notes, and snippets.

@gphilipp
gphilipp / HomeServlet.java
Created February 4, 2012 17:52
The servlet
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
public class HomeServlet extends HttpServlet {
public static final String LOGIN_PAGE = "/login.jsp";
@gphilipp
gphilipp / datomic-utils.md
Last active April 8, 2018 17:45
datomic snippets

Datomic Snippets

;; find the idents of all schema elements in the system
(sort (d/q '[:find [?ident ...]
             :where [_ :db/ident ?ident]]
 db))
@gphilipp
gphilipp / gpg_datomic.md
Last active July 26, 2020 15:48
GPG commands for Datomic
(defn dashboard-component-view [cursor owner {:keys [div-id title]}]
(reify
om/IInitState
(init-state [_]
(let [width 960 height 500]
{:width width :height height
:comm (chan)
:svg nil
}))
om/IRender
(defn portfolio-perf-view [cursor owner {:keys [div-id title]}]
(reify
om/IRender
(render [_]
(dom/div #js {:id div-id}
(dom/svg nil)))
om/IDidMount
(did-mount [_]
(.addGraph js/nv
(fn []
@gphilipp
gphilipp / cursive_wishlist.md
Last active June 7, 2017 11:29
My cursive wishlist

My Cursive Wishlist

Features

  • Launch tests with IntelliJ Test runner
  • Introduce a 'duplicate sexp' action (instead of Copy as Kill, go to next line, paste)

Improvements

  • Align map support for map destructuring: {:keys [title color]} @project
  • No completion for clojurescript in repl. If I do  (def my-var "foo"), it can’t autocomplete my-var, and highlights it
  • can’t recognize stuff like (reg-sub :foo …) as a top level form, so it skips over those when navigating up and down to top-level forms.
@gphilipp
gphilipp / Mac_apps_to_install.md
Last active January 20, 2017 06:49
Mac apps to install

Mac apps to install

  • Dropbox
  • Spotify
  • Chrome + React tools
  • Airfoil
  • Atom
  • 1Password
  • IntelliJ
  • (iTerm not needed anymore, terminal is good in Yosemite)
@gphilipp
gphilipp / ambly-react-native.md
Last active January 19, 2016 22:24
Ambly iOS react native

React native with Om/Ambly/Natal experience

Troubleshooting

When the simulator can't start anything try this:

(require '[datomic.api :as d])
(def dburi "datomic:dev://localhost:4334/koturo")
;; failed projects
(map first (d/q '[:find (pull ?p [*])
:where
[?p :project/closed true]
[?p :project/successful false]
]
(d/db (d/connect dburi))))
| :project/platform | :project/name | :project/terms | :project/average-rate | :project/fixed-rate | :project/end-date |
|-------------------+---------------------------------------------------------------+----------------+-----------------------+---------------------+-------------------------------|
| Lendosphere | Pretez a InnoVent pour le developpement du solaire en Afrique | 48 | | 6.0 | Sun Oct 18 02:00:00 CEST 2015 |
| Lendopolis | Nouveaux espaces de jeux | 48 | | 10.5 | Thu Oct 15 02:00:00 CEST 2015 |
| Unilend | C.G.M.O.D. | 48 | 8.9 | | Thu Oct 15 02:00:00 CEST 2015 |
| Lendopolis | Electricité et Superstructures | 48 |