Skip to content

Instantly share code, notes, and snippets.

😎
Developing

Adam Recvlohe arecvlohe

😎
Developing
Block or report user

Report or block arecvlohe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@arecvlohe
arecvlohe / App.re
Last active Jun 21, 2019
A simple example of type safe styles in reason-react-starter
View App.re
module Styles = {
open Css;
let container = style([padding(px(20)), fontFamily("sans-serif")]);
let card =
style([
maxWidth(px(500)),
marginTop(px(20)),
margin2(~v=px(0), ~h=auto),
padding(px(20)),
border(px(1), solid, hex("eee")),
@arecvlohe
arecvlohe / package.json
Last active Jun 21, 2019
A simple package.json for reason-react-starter
View package.json
{
"name": "reason-react-starter",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"start": "concurrently \"npm run js-watch\" \"npm run bsb-watch\"",
"js-watch": "webpack-dev-server --hot --inline",
"bsb-watch": "bsb -make-world -w",
"bsb-clean": "bsb -clean-world"
@arecvlohe
arecvlohe / client.js
Last active Jun 21, 2019
A simple client file for reason-react-starter
View client.js
import React from "react";
import ReactDOM from "react-dom";
import "normalize.css";
import { make as App } from "../lib/es6_global/src/App";
ReactDOM.render(<App />, document.querySelector("#root"));
@arecvlohe
arecvlohe / App.re
Last active Jun 21, 2019
A simple App component for reason-react-starter
View App.re
/* Make the component */
[@react.component]
let make = () => {
<div> {"Reason React!" |> ReasonReact.string} </div>
};
@arecvlohe
arecvlohe / index.html
Created Sep 27, 2018
A simple index.html file for reason-react-starter
View index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
</head>
<body>
<div id="root"></div>
</body>
</html>
@arecvlohe
arecvlohe / bsconfig.json
Last active Jun 21, 2019
A simple bsconfig for reason-react-starter
View bsconfig.json
{
"name": "reason-react-starter",
// The syntax version for reason
"refmt": 3,
// The reason jsx syntax
"reason": { "react-jsx": 3 },
// The folder to look in to find reason files
"sources": ["src"],
// How to output the files
"package-specs": [
@arecvlohe
arecvlohe / webpack.config.js
Last active Jun 21, 2019
A simple webpack config for reason-react-starter
View webpack.config.js
const path = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const { CleanWebpackPlugin } = require("clean-webpack-plugin");
module.exports = {
// The file that is the main point of access for the SPA
entry: path.join(__dirname, "src/client.js"),
// Where you want to output the file
output: {
// The output file's name
View gist:b8342497b759eae53855853cf21dd07a
Verifying my Blockstack ID is secured with the address 1GmCgCPqrKKUx7JyUhJCZWHd4aeCpXxQX2 https://explorer.blockstack.org/address/1GmCgCPqrKKUx7JyUhJCZWHd4aeCpXxQX2
View corruptionChecksum.re
let getMax =
Js.Array.reduce((acc, curr) => Js.Math.max_int(acc, curr), min_int);
let getMin =
Js.Array.reduce((acc, curr) => Js.Math.min_int(acc, curr), max_int);
let corruptionChecksum = (path) =>
Node_fs.readFileSync(path, `utf8)
|> Js.String.trim
|> Js.String.split("\n")
@arecvlohe
arecvlohe / inverseCaptcha.re
Last active Feb 7, 2018
Advent of Code - Day 1
View inverseCaptcha.re
let inverseCaptcha = (path) => {
let arr =
Node_fs.readFileSync(path, `utf8)
|> Js.String.trim
|> Js.String.split("");
Js.Array.reducei(
(acc, curr, idx) =>
switch (idx == 0) {
| true =>
let firstValue = int_of_string(curr);
You can’t perform that action at this time.