Skip to content

Instantly share code, notes, and snippets.

View cbillowes's full-sized avatar
:octocat:

Clarice Bouwer cbillowes

:octocat:
View GitHub Profile
@cbillowes
cbillowes / snippets.clj
Last active July 22, 2018 08:20
Nifty Snippets
; https://stackoverflow.com/questions/36032562/extract-values-from-vector-of-maps-conditionally-in-clojure
(map val (filter (comp #{:a} key) (apply concat vector-of-maps)))
; Grab URL from JavaScript window API
(ns awesome.stuff.to.learn
(:require [cemerick.url :as url]))
(defn [] (:anchor (url/url (-> js/window .-location .-href))))
; (compare-and-swap) function takes four arguments: an entity id, an attribute, an old value, and a new value.
@cbillowes
cbillowes / gremlins.clj
Last active July 21, 2018 03:03
A collection of errors and many silly mistakes to remind myself what I did to fix them next time.
; java.lang.RuntimeException: Unable to resolve symbol: catch in this context, compiling: <file>:<line>:<column>
; catch` is not a function or macro, it's special syntax only understood in the context of the special form `try`. You can't do this without writing your own form of try (see try+ in slingshot for an example of that).
; https://groups.google.com/forum/#!topic/clojure/4EN7RDbKqVE
; example - but still doesn't work in my code
; https://github.com/scgilardi/slingshot
(ns math.expression
(:require [tensor.parse]
@cbillowes
cbillowes / scrapbook.markdown
Last active April 22, 2018 16:07
Scrapbook

.bat to iterate through files and extract the first 10 characters from its name.

setlocal ENABLEDELAYEDEXPANSION

for %%f in (posts/*) do (
    set var=%%f
    @echo %var:~0,10%

)

@cbillowes
cbillowes / SSH.md
Last active April 19, 2018 05:33
Get SSH to work on Windows for Github and BitBucket

Get SSH to work on Windows for Github and BitBucket

Install git

  • I chose native Windows Secure Channel Library
  • Previously I was having a lot of trouble getting setup. I am not sure if the SSL/TLS library caused this or not.

Using Git Bash

  • ssh-keygen with passphrase