Skip to content

Instantly share code, notes, and snippets.

@wokalski
wokalski / Readme.md
Last active February 21, 2020 12:44
BuckleScript friendly `vim` + official ocaml-lsp setup for Reason/OCaml

BuckleScript friendly vim + official ocaml-lsp setup for Reason/OCaml

Prerequisite: Install esy 0.6.0.

Steps

  1. Check esy version (it has to be >0.6.0)
  2. Create esy.json with the following contents next to package.json:
type messageDescriptor = {. "id": string, "defaultMessage": string};
[@bs.module "react-intl"]
external defineMessages : Js.Dict.t(messageDescriptor) => Js.Dict.t(messageDescriptor) =
"";
module FormattedMessage = {
[@bs.module "react-intl"] external formatMessage : ReasonReact.reactClass = "FormattedMessage";
let make =
(
@SllyQ
SllyQ / Dnd.re
Created November 14, 2017 11:27
open ExtUtils;
module DragDropContext = {
[@bs.module "react-beautiful-dnd"] external reactClass : ReasonReact.reactClass =
"DragDropContext";
Js.log(reactClass);
let make = (~onDragEnd, children) =>
ReasonReact.wrapJsForReason(~reactClass, ~props={"onDragEnd": onDragEnd}, children);
};
@busypeoples
busypeoples / UIPattern.re
Last active January 28, 2019 15:31
Slaying a UI Anti Pattern in ReasonML
/*
Slaying a UI Anti Pattern in ReasonML
Based on Kris Jenkins original writing.
http://blog.jenkster.com/2016/06/how-elm-slays-a-ui-antipattern.html
*/
type remoteData 'e 'a =
| NotAsked
| Loading
| Failure 'e
| Success 'a;
@novaluke
novaluke / 0-Q&A.md
Last active April 29, 2023 17:23
I want to use Nix for development, but... -- answers to common concerns about Nix

Nix seems perfect for developers - until I try to use it...

Want to use Nix for development but you're not sure how? Concerned about the fluidity of nixpkgs channels or not being able to easily install arbitrary package versions?

When I first heard about Nix it seemed like the perfect tool for a developer. When I tried to actually use it for developing and deploying web apps, though, the pieces just didn't seem to add up.

@beanieboi
beanieboi / gist:ad526faf063181f336a2
Last active May 11, 2023 15:59
Codeship Nginx Config for Heroku
daemon off;
# Heroku dynos have at least 4 cores.
worker_processes <%= ENV['NGINX_WORKERS'] || 4 %>;
events {
use epoll;
accept_mutex on;
worker_connections 1024;
}
@ericelliott
ericelliott / essential-javascript-links.md
Last active May 17, 2024 03:38
Essential JavaScript Links
@moimikey
moimikey / config.js
Created October 21, 2014 01:29
ultimate webpack config. work in progress...
module.exports = {
port: 8000,
globals: {
$: 'jquery',
jQuery: 'jquery',
_: 'lodash',
Backbone: 'backbone',
Marionette: 'backbone.marionette',
moment: 'moment'
},
@john2x
john2x / 00_destructuring.md
Last active June 6, 2024 13:40
Clojure Destructuring Tutorial and Cheat Sheet

Clojure Destructuring Tutorial and Cheat Sheet

(Related blog post)

Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.

Vectors and Sequences

@chrisgillis
chrisgillis / ssl_smtp_example.go
Created April 16, 2014 14:48
Golang SSL SMTP Example
package main
import (
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"crypto/tls"
)