Skip to content

Instantly share code, notes, and snippets.

View jetmind's full-sized avatar

Igor Bondarenko jetmind

View GitHub Profile
@borkdude
borkdude / cljscript
Last active July 4, 2018 16:34
Execute all in one clj script
deps=`awk '/^;; deps.edn$/{flag=1;next}/^;; end deps.edn$/{flag=0}flag' $1`
script=`awk '/^;; script$/{flag=1;next}/^;; end script$/{flag=0}flag' $1`
clj -Sdeps "$deps" -e "$script"

Looking into the Future

futures-rs is the library which will hopefully become a shared foundation for everything async in Rust. However it's already become renowned for having a steep learning curve, even for experienced Rustaceans.

I think one of the best ways to get comfortable with using a library is to look at how it works internally: often API design can seem bizarre or impenetrable and it's only when you put yourself in the shoes of the library author that you can really understand why it was designed that way.

In this post I'll try to put down on "paper" my understanding of how futures work and I'll aim to do it in a visual way. I'm going to assume you're already somewhat familiar with Rust and why futures are a useful tool to have at one's disposal.

For most of this post I'll be talking about how things work today (as of September 2017). At the end I'll touch on what's being proposed next and also make a case for some of the changes I'd like to see.

If you're interested in learning more ab

(ns stripboard.db
(:require [korma.db :refer [sqlite3 defdb]]
[korma.core :as korma]
[om.next.server :as om]))
(defdb db (sqlite3 {}))
(defmulti read-table (fn [_ k _] k))
(defmethod read-table :default
@jordwalke
jordwalke / gist:6350319
Last active September 10, 2016 16:27
ReactJS: JavaScript just like you've always done it.
/**
* ReactJS: JavaScript like you've always done it.
*
* This example renders your top ten most followed friends/followers, `filter`ing
* only your favorites, and putting a star on all verified accounts.
*
* With ReactJS, any time your data changes, the UI is always brought up to date
* automatically. If friends length changes, or followCount - it always shows what
* `render` describes.
*/
@nblumoe
nblumoe / vim_fireplace_paredit_cheat_sheet.md
Created April 24, 2013 06:41
Simple cheat sheet for vim fireplace and paredit

fireplace

  • cpr => (require ... :reload)
  • cpR => (require ... :reload-all)

Evaluation

  • :Eval (clojure code) => runs (clojure code) in repl
  • cpp => evaluate inn-most expessions under cursor
  • cp<movement> => evaluate text described by <movement>
  • cqp => opens quasi-repl
  • cqc => quasi-repl command line window