Skip to content

Instantly share code, notes, and snippets.

View brianium's full-sized avatar
🕊️
Human

Brian Scaturro brianium

🕊️
Human
View GitHub Profile

Keybase proof

I hereby claim:

  • I am brianium on github.
  • I am scaturr (https://keybase.io/scaturr) on keybase.
  • I have a public key ASD_8p-G0P3ay3-BKXbhoKV516tPX2WJnbA8ZxyLLgv_QAo

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]
@brianium
brianium / peridot.php
Created December 20, 2015 15:34
Configure the peridot test directory
<?php
use Evenement\EventEmitterInterface;
/**
* Configure peridot.
*
* @param EventEmitterInterface $eventEmitter
*/
return function (EventEmitterInterface $eventEmitter) {
@brianium
brianium / php-xdebug.ini
Created May 28, 2015 00:45
xdebug ini settings for php thangs
[xdebug]
zend_extension = 'blahblahblah'
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
@brianium
brianium / span.exs
Created April 16, 2015 23:08
list span in elixir
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) ]
@brianium
brianium / PromiseObserver.js
Created March 4, 2015 20:30
Potential implementation for loading graphics?
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');
});
@brianium
brianium / interval.go
Last active August 29, 2015 14:11
interval.go
package main
import (
"time"
"fmt"
)
type Interval struct {
Start time.Time
End time.Time
@brianium
brianium / interval.go
Created December 18, 2014 19:09
interval.go
import "time"
type Interval struct {
Start Time
End Time
}
func NewInterval(start string, end string) Interval {
startTime, err := time.Parse(time.RFC3339, start)