Instantly share code, notes, and snippets.

View gist:15aeeff4c4bb46b01abfdeef19191b14
Part 2
- run a server with "npx http-server -p 3000 -c-1", and open `http://localhost:3000/src/simple` in your browser
- https://github.com/apollographql/reason-apollo -- follow the setup instructions
- the "apollo http link" url should be "https://serve.onegraph.com/dynamic?app_id=0b33e830-7cde-4b90-ad7e-2a39c57c0e11"
- get the query from discord
Goal 2: run the query, and render the `response##rss##rss2Feed##title` to the page.
View gist:7cc7b8c76513017b799a23168952f08f
WIFI: MSFTGuest -- on the login website, use the "Access code": msevent394hr
go to discord.gg/reasonml
the instructions are in the #reason-dojo channel
Goal: Make a podcast app, using the GraphQL query that's in the channel.
If you have questions, raise your hand!
Also feel free to ask things in the #reason-dojo channel
- clone https://github.com/reasonml-community/reason-react-example
View gist:c9cab8507984f3edbc2b7a2b1f07983b
type animatable('t) =
| AtRest('t)
| BetweenFrames({pre: 't, post: 't, info: animationInfo})
type state = {
expanded: animatable(bool),
disabled: animatable(bool)
}
View .bash_profile
# Super often, these are muscle memory
alias g=git
alias gs="git status"
alias gb="git b"
alias gd="git diff"
# See the git aliases section, but this is "git branch" but better
# (sorted by most recent, and other things)
alias gr="git r"
# Used as `gitca "commit message"` and it's done
View Europe.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View App.re
module StringContext =
Context.MakePair({
type t = string;
let defaultValue = "Awesome";
});
let component = ReasonReact.statelessComponent("Tree");
let make = _children => {
View BasicServer.re
let recv = (client, maxlen) => {
let bytes = Bytes.create(maxlen);
let len = Unix.recv(client, bytes, 0, maxlen, []);
Bytes.sub_string(bytes, 0, len)
};
let parse_top = top => {
let parts = Str.split(Str.regexp("[ \t]+"), top);
switch (parts) {
View ApolloWrapper.js
// @flow
import {Component, type Node} from 'react'
import authenticatedApolloClient from '../shared/authenticatedApolloClient';
/**
* Example usage:
*
* const ScreenWithLoader = (props) => <ApolloWrapper
* queryOptions={{
View gist:a5e0102c060b7a1b40525d41f87843a8
let module Styled = {
let module Create (Config: {
let name: string;
let style: ReactNative.Style.style;
}) => {
let component = ReasonReact.statelessComponent Config.name;
let make ::paddingVertical=? => {
let style = combineStylesSomeHow Config.style paddingVertical; /* <- this is an optional btw */
View.make ::style
View template-function-syntax.re
/* Template for proposals to update the syntax. Base template: https://gist.github.com/jordwalke/6935739b74eb9b8496670cc7860f5acf */
let a = 10;
let b = 20;
/* A */
let nonNamed = (a, b) => a + b;
type nonNamed = (int, int) => int;