#Clojure Doc Exploration
Go through them docs
** Last looked at "with-bindings"**
Agents are things. Part of writing async code in clojure
#Clojure Doc Exploration
Go through them docs
** Last looked at "with-bindings"**
Agents are things. Part of writing async code in clojure
I hereby claim:
To claim this, I am signing this object:
; roll your own nth function | |
; my super long version | |
(fn [coll n] | |
(loop [c coll count 0] | |
(if (= count n) | |
(first c) | |
(recur (next c) (inc count))))) | |
; some other dudes cooler version |
(defprotocol FIXO | |
(fixo-push [fixo value]) | |
(fixo-pop [fixo]) | |
(fixo-peek [fixo])) | |
(extend-type TreeNode | |
FIXO | |
(fixo-push [node value] | |
(xconj node value)) | |
(fixo-peek [node] |
<?php | |
use Evenement\EventEmitterInterface; | |
/** | |
* Configure peridot. | |
* | |
* @param EventEmitterInterface $eventEmitter | |
*/ | |
return function (EventEmitterInterface $eventEmitter) { |
[xdebug] | |
zend_extension = 'blahblahblah' | |
xdebug.remote_autostart = 1 | |
xdebug.remote_enable = 1 |
defmodule MyList do | |
def span(from, to), do: _span(from, to, []) | |
defp _span(from, to, list) when from == to do | |
list ++ [to] | |
end | |
defp _span(from, to, list) do | |
list ++ [from | _span(from + 1, to, list) ] |
function PromiseObserver() { | |
this.observables = { | |
root: false; | |
}; | |
} | |
/** | |
* @param {object} promise a promise to reserve | |
* @return {object} the observed promise | |
*/ |
<?php | |
it('should return the newly created resource', function() { | |
$this->collection->insert($this->currentJson['users'])->willReturn(true); | |
$response = $this->controller->create($this->request); | |
expect($response)->to->have->status(201); | |
expect($response)->json->to->have->deep->property('users->login', 'brian'); | |
}); |
package main | |
import ( | |
"time" | |
"fmt" | |
) | |
type Interval struct { | |
Start time.Time | |
End time.Time |