Skip to content

Instantly share code, notes, and snippets.

@pandeiro
pandeiro / change.clj
Created March 4, 2017 00:08
Renders coins and headaches
;; This buffer is for Clojure experiments and evaluation.
;; Press C-j to evaluate the last expression.
;; Hey Sameer, thanks again for taking the time today. I'm afraid my
;; solution is gonna be a little disappointing; nonetheless I wanted
;; to share it.
;; The algorithm I wanted to write was: for each coin, there is a
;; positive sequence of values that represent c0, c1 ... cn where n
;; cannot be greater than the value of the change targeted. Iterating
@pandeiro
pandeiro / quick-clojure.el
Last active February 3, 2017 23:57
An elisp snippet for quickly getting Clojure and tooling support into Emacs
;;
;; Evaluate the form below or add it to your Emacs initialization file
;; to add Clojure support to Emacs.
;;
;; Required system dependencies:
;; - JDK 1.7+
;; - wget
;;
(let* ((github-url "https://raw.githubusercontent.com/")
(lein-url (concat github-url "technomancy/leiningen/stable/bin/lein"))
gistup
@pandeiro
pandeiro / AppComponent.cjsx
Created April 4, 2016 20:17 — forked from bensmithett/AppComponent.cjsx
The world's tiniest guide to getting started with React, JSX, CoffeeScript & Webpack
React = require("react")
VideoPlayerComponent = require("components/VideoPlayerComponent")
AppComponent = React.createClass
# Need to add this manually if you want it to show up in React Chrome Dev Tools
# See https://github.com/jsdf/coffee-react-transform/issues/16
displayName: "AppComponent"
render: ->
<div>

hiredman [6:39 PM]

I just don't understand why people use mount, I must be missing something, its model of each namespace as a component, with state as a global thing in a namespace(maybe I am mistunderstanding this), just seems bad, like sticking (def state (atom {})) in every namespace would be

[6:41] https://github.com/tolitius/mount/blob/master/src/mount/core.cljc#L10-L14

GitHub tolitius/mount mount - managing Clojure and ClojureScript app state since (reset)

project.clj:
(defproject vat "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[org.webjars/bootstrap "3.3.1"]]
:plugins [[deraen/lein-less4j "0.2.1"]]
[{:service_type :postgres
:machine "aggregator"
:service "postgres"
:config {:db {:host "localhost"
:user "dashwise"
:database "dashwise_collector"
:port 25432
:password "dashwise"}}}
{:service_type :oracle
mu@power:~/repos/com/github/Buzzlabs/dashwise/src/dashwise-collectors $ lein run
2015-Mar-25 09:04:56 -0300 power DEBUG [dashwise-collectors.main] - args nil
2015-Mar-25 09:04:57 -0300 power DEBUG [dashwise-collectors.scheduler] - starting scheduler
[main] INFO org.quartz.impl.StdSchedulerFactory - Using default implementation for ThreadExecutor
[main] INFO org.quartz.simpl.SimpleThreadPool - Job execution threads will use class loader of thread: main
[main] INFO org.quartz.core.SchedulerSignalerImpl - Initialized Scheduler Signaller of type: class org.quartz.core.SchedulerSignalerImpl
[main] INFO org.quartz.core.QuartzScheduler - Quartz Scheduler v.2.1.7 created.
[main] INFO org.quartz.simpl.RAMJobStore - RAMJobStore initialized.
[main] INFO org.quartz.core.QuartzScheduler - Scheduler meta-data: Quartz Scheduler (v2.1.7) 'DefaultQuartzScheduler' with instanceId 'NON_CLUSTERED'
Scheduler class: 'org.quartz.core.QuartzScheduler' - running locally.
(ns dashwise-dashboard.views
(:require
[clojure.string :as s]
[reagent.core :as r]
[dashwise-dashboard.views.bootstrap :as bootstrap]
[dashwise-dashboard.views.styles :as styles]
[dashwise-dashboard.views.util :refer [target-val]]
[dashwise-dashboard.models :as models]
[dashwise-dashboard.state :refer [app-state history]]))