Skip to content

Instantly share code, notes, and snippets.

View arathnim's full-sized avatar
:octocat:
In the wired

Dylan Ball arathnim

:octocat:
In the wired
View GitHub Profile
const NoteList = () => {
const [loading, notes] = useQuery(
api => api.notes.all().select('{ id title }')
)
return loading ? <Loading /> : '...';
}
const Note = ({id}) => {
const [loading, note] = useQuery(
(proclaim '(optimize (speed 0) (safety 3) (debug 3) (space 0)))
;(declaim #+sbcl(sb-ext:muffle-conditions style-warning))
;(declaim #+sbcl(sb-ext:muffle-conditions warning))
;; TODO
;; [x] switch over to destructuring-match for give and award
;; [ ] make a more general inventory system
;; [ ] note/definition thing
;; [ ] better auth methods
;; [ ] number designator 'all'
exports.down = knex =>
Promise.all([
knex.schema.dropTableIfExists('boards'),
knex.schema.dropTableIfExists('threads'),
knex.schema.dropTableIfExists('posts'),
])
exports.up = knex =>
Promise.all([
knex.schema
import TagDemo from './Tag-Fs-Demo'
class Post extends React.Component {
constructor(props) {
super(props);
this.state = {data: "foo"};
fetch("/posts/" + this.props.match.params.path + ".json").then(x => x.json()).then(x => {this.setState({data: x})})
}
componentDidUpdate() {
@arathnim
arathnim / flag.lisp
Created February 27, 2018 23:52
CLI flag DSL
(defflag width :long "width" :short "w" :parse integer)
(defflag height :long "height" :short "h" :parse integer)
(defflag user :long "user" :short "u" :parse nil)
(defflag host :long "host" :short "H" :parse valid-hostname)
# fictional ruby irc library
class Remind < Command
defparser handle(time:t, raw_string:s)
remind_queue.push([t + current_time, s])
end
# start a thread to check over the queue
end
@arathnim
arathnim / lush
Last active September 25, 2017 23:30
Lisp Shell Code
mv [f ".lisp" => f ++ ".cl"]
sum (map [file:f int:s => s] (read-lines ./file.txt))
read-lines ./file.txt | map [File:f Int:s => s] | sum
thread-map [json:j => j | :language] (http-get "api.github.com/search/repos/foo") | append
sum [x | x <- [1..999], x % 3 == 0 || x % 5 == 0]
str = read-file ./file.txt
(quickload/use '(aphasia arrows alexandria drakma cl-ppcre cxml))
(-> (read-file "~/rss")
(split "\\n")
(thread-map
(compose
(http-request)
(xml->sexp)
(map (recur-match-all 'item))))
(flatten 1)

Keybase proof

I hereby claim:

  • I am Arathnim on github.
  • I am arathnim (https://keybase.io/arathnim) on keybase.
  • I have a public key whose fingerprint is A2BB 033F DC67 D2CC 481A 3A49 7953 1836 CE5E E6F3

To claim this, I am signing this object: