Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Developing

Adam Recvlohe arecvlohe

😎
Developing
View GitHub Profile
@Phate6660
Phate6660 / rust recommendations and alternatives.md
Last active Jan 10, 2021
My growing list of Rust programs to use.
View rust recommendations and alternatives.md
@IanColdwater
IanColdwater / twittermute.txt
Last active Jan 13, 2021
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
@broerjuang
broerjuang / feedback_form.re
Created Sep 15, 2019
An experiment using state machine using ReasonML
View feedback_form.re
open ReactUpdate;
type context = {
rate: int,
comment: string,
};
type action =
| Open
| Close
@abenoit
abenoit / ClickOutside.re
Last active Apr 3, 2019
ReasonML Binding for react-click-outside
View ClickOutside.re
[@bs.module "react-click-outside"]
external clickOutside: ReasonReact.reactClass = "default";
[@bs.deriving abstract]
type jsProps = {
className: option(string),
onClickOutside: ReactEvent.Mouse.t => unit,
};
let make = (~className=?, ~onClickOutside, children) =>
@joshburgess
joshburgess / flatten.js
Last active Feb 10, 2018
Solutions showing how to flatten arbitrarily nested arrays of ints in JavaScript
View flatten.js
// shorthand function for the Number.isInteger method
const isInt = Number.isInteger
// shorthand function for the Array.isArray method
const isArray = Array.isArray
// functional wrapper for the Array.reduce method
const reduce = f => initVal => arr => arr.reduce(f, initVal)
// functional wrapper for the Array.concat method
View ReasonReact.dockerfile
FROM node:6
RUN npm install -g bs-platform
RUN yarn global add serve
# Copy just the package.json first to install deps
ADD src/package.json /app/package.json
WORKDIR /app
RUN npm install
@kumekay
kumekay / rename_phoenix_project.sh
Last active Jun 23, 2020 — forked from nerdyworm/rename.sh
rename a phoenix 1.3 project
View rename_phoenix_project.sh
#!/bin/bash
set -e
CURRENT_NAME="CurrentName"
CURRENT_OTP="current_name"
NEW_NAME="NewName"
NEW_OTP="new_name"
@busypeoples
busypeoples / PhantomTypeReasonML.md
Last active Nov 28, 2020
Phantom types in ReasonML
View PhantomTypeReasonML.md

Phantom types in ReasonML

Introduction

"A phantom type is a parametrised type whose parameters do not all appear on the right-hand side of its definition..." Haskell Wiki, PhantomType

The following write-up is intended as an introduction into using phantom types in ReasonML.

Taking a look at the above definition from the Haskell wiki, it states that phantom types are parametrised types where not all parameters appear on the right-hand side. Let's try to see if we can implement a similar example as in said wiki.

@kritzcreek
kritzcreek / random-numbers.md
Last active May 9, 2020
Collections of random numbers in PureScript
View random-numbers.md

Generating collections of random numbers in PureScript

A problem that I've seen beginners run into in Haskell or PureScript a couple of times now is how to generate a List of random numbers. It's a common requirement for little games (which make for great first projects) to generate these, and it definitely seems to be a stumbling block.

Why are random numbers hard?

Randomness is considered a side effect in purely functional languages, which means that to generate them you usually need access to Eff/IO, which in turn means we need to deal with Monads. And while generating a single random number is usually pretty easy with do-notation, the typical intuition beginners have built when going from single values to a collection is to use map, but that fails.

Type-Directed-Search to the rescue

@justinwoo
justinwoo / differences-from-elm.md
Last active Mar 25, 2020
This document is likely out of date. See this page for general information: https://purescript-resources.readthedocs.io/. Differences of Purescript from Elm (The resource that I wish I had when starting with Purescript, or when revisiting Elm)
View differences-from-elm.md

Differences of Purescript from Elm

The syntax between Elm and Purescript are mostly the same, to the point where most Elm code can be converted to Purescript with copy-pasting and find-replace/multi-cursor editing.

Purpose of this document

Many people who have used Elm who are curious about/have tried/are using Purescript have asked me to put together a "differences from Elm" post to help them, and which I would also have found helpful.

Type Annotations

You can’t perform that action at this time.