Skip to content

Instantly share code, notes, and snippets.

View brianium's full-sized avatar
🕊️
Human

Brian Scaturro brianium

🕊️
Human
View GitHub Profile
@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 / 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) {
(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]
; 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

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:

#Clojure Doc Exploration

Go through them docs

** Last looked at "with-bindings"**

agent

Agents are things. Part of writing async code in clojure

refs

(watermark "some-resource.jpg"
(with-image "another-resource.jpg" lower-right)
(with-text "hello world!" my-draw)
(with-image "some-image.jpg" upper-left)
(append-to-thangs))
(def i (js/Image.))
(def p (js/Promise. (fn [resolve]
(set! (.-onload i) #(resolve i))
(set! (.-src i) "url.jpg"))))
(.then p (.-log js/console))
@brianium
brianium / WpdbAdapter.php
Created March 28, 2017 18:58
Barebones Phinx adapter powered by wpdb
<?php
use Phinx\Db\Adapter\AdapterInterface;
use Phinx\Db\Adapter\MysqlAdapter;
use Phinx\Db\Table;
use Phinx\Db\Table\Column;
use Phinx\Db\Table\ForeignKey;
use Phinx\Db\Table\Index;
use Phinx\Migration\MigrationInterface;
use Symfony\Component\Console\Output\NullOutput;
@brianium
brianium / PdoLikeObject.php
Created March 28, 2017 19:00
Provides the minimum interface required for Phinx's use of PDO within adapters.
<?php
/**
* Class PdoLikeObject - its like PDO, but not!
*/
class PdoLikeObject
{
/**
* Return the given value after it has been quoted by WordPress' esc_sql function
*