Skip to content

Instantly share code, notes, and snippets.

View dwwoelfel's full-sized avatar

Daniel Woelfel dwwoelfel

View GitHub Profile
external commentItem : ReasonReact.reactClass = "./CommentItem" [@@bs.module];
let make ::_type ::id ::user ::timeAgo ::content children =>
ReasonReact.wrapJsForReason
reactClass::commentItem
props::{"type": _type, "id": id, "user": user, "timeAgo": timeAgo, "content": content}
children;
@dwwoelfel
dwwoelfel / app.js
Last active November 15, 2017 12:47
OneGraph YouTube Demo
const VideoQuery = gql`
query videoPlayerQuery {
ytVideo(id: $videoId) {
id
statistics {
viewCount
likeCount
dislikeCount
}
snippet {
@dwwoelfel
dwwoelfel / app.js
Last active May 29, 2017 01:20
OneGraph YouTube Demo
const VideoQuery = gql`
query videoPlayerQuery {
ytVideo(id: $videoId) {
player {
embedHtml
}
statistics {
viewCount
likeCount
@dwwoelfel
dwwoelfel / app.js
Last active May 28, 2017 17:55
OneGraph YouTube Demo
'placeholder'
utop # #require "websocket.lwt";;
File "", line 1, characters 0-4:
Error: Parse error: illegal begin of top_phrase
Fatal error: exception Exit
Raised at file "bytes.ml", line 220, characters 25-34
@dwwoelfel
dwwoelfel / ratings.md
Last active August 29, 2015 14:07
Playing around with clojurecup ratings
@dwwoelfel
dwwoelfel / gist:b859cee4b5f41af37ffd
Created August 1, 2014 21:05
Rough notes for setting up elastic beanstalk on CircleCI

In your repo's root directory, check in a requirements.txt with

boto==2.30.0

Then, from the project's Project Settings > Environment Variables page, add the two env vars: AWS_ACCESS_KEY_ID and AWS_SECRET_KEY, with an IAM key that can deploy to eb.

Then create a bash script to set up eb:

@dwwoelfel
dwwoelfel / utils.clj
Created August 1, 2014 06:31
Hack to get something approximating paint rectangles with React/om. Has very rough edges!
(defmacro html [body]
`(if-not (:render-colors? initial-query-map)
(html/html ~body)
(let [body# ~body]
(try
(let [[tag# & rest#] body#
attrs# (if (map? (first rest#))
(first rest#)
{})
rest# (if (map? (first rest#))
@dwwoelfel
dwwoelfel / user.clj
Created July 12, 2014 02:22
Finds and fixes all of the bad php urls in php-build
(ns user
(:require [clojure.string :as string]
[clj-http.client :as http]))
(defn definition-files []
(let [basedir "/Users/daniel/projects/php-build/share/php-build/definitions"]
(map #(fs/join basedir %) (fs/listdir "/Users/daniel/projects/php-build/share/php-build/definitions"))))
(defn parse-url [file]
(last (re-find #"(?m)install_package \"([^\"]+)\"" (slurp file))))