Skip to content

Instantly share code, notes, and snippets.

View fredcy's full-sized avatar

Fred Yankowski fredcy

View GitHub Profile
@ryan-haskell
ryan-haskell / Api.elm
Created July 12, 2020 05:23
Used in the "Using APIs" section of in the elm-spa guide
-- src/Api.elm
module Api exposing (Data(..), expectJson)
import Http
import Json.Decode as Json
type Data value
= NotAsked
| Loading
#!/bin/bash
#
# 20210119 - Use the new --endpoint flag
# - Added verbose logging
#
# 20200608 - Updated to TzKt API
#
# 20191029 - Added /v3/network back in.
# Thanks to Baking-Bad and their Mystique API
@et4te
et4te / htlc.ml
Last active August 5, 2018 09:36
Tezos Atomic Swap
[%%version 0.3]
type storage =
{ version : string;
secret_hash : bytes;
issuer : address;
issuer_hash : key_hash;
recipient_hash : key_hash;
timeout : timestamp;
}
// Discord all events!
// A quick and dirty fleshing out of the discord.js event listeners (not tested at all!)
// listed here -> https://discord.js.org/#/docs/main/stable/class/Client
// Learn from this, do not just copy it mofo!
//
// Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584
// Last Updated -> Halloween 2022
/*
@dakk
dakk / tezos-baking-howto.md
Last active March 6, 2022 21:22
tezos-baking-howto.md

Tezos baking howto

This howto is valid for Betanet on Ubuntu or Debian

Setup

Prereq

You have to install some dependencies. In debian / ubuntu run:

@suhlig
suhlig / install-tmux
Last active October 12, 2023 21:25 — forked from philipsd6/install-tmux
Install tmux on rhel/centos
# Install tmux on rhel/centos 7
# What do we want?
libeventversion=2.1.11
tmuxversion=3.1
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
@klaftertief
klaftertief / reactiveconf-2016-lightning-talk.md
Last active April 2, 2024 20:17
An API search engine in Elm for Elm, proposal for a Lightning Talk at ReactiveConf 2016

An API search engine in Elm for Elm

Elm is a statically typed functional language that compiles to JavaScript. It's well-known for its developer experience: the compiler provides nice error messages, the package system enforces semantic versioning for all published packages and makes sure every exposed value or type has some documentation and type annotations.

module Slider exposing (Model, Msg, init, update, view)
import Html exposing (..)
import Html.Attributes as A
import Html.Events exposing (..)
import Json.Decode as D
import String as S
type alias Model =
{ name : String
, min : Float
import Effects exposing (Effects(..), Never)
import Html exposing (Html, div, button, text)
import Html.Events exposing (onClick)
import Signal exposing (Mailbox)
import StartApp as SA
import Task exposing (Task(..))
type Request = DummyRequest | Request String
type Response = Response String
import Graphics.Element exposing (show)
import List exposing (map, map2, length, repeat, concat, sum, foldl, filterMap, isEmpty, member, head, tail, indexedMap, filter)
import Maybe exposing (andThen)
import Color
import Graphics.Element exposing (..)
--main = show <| constrainLine [1, 1] [Nothing, Just False, Nothing, Nothing]
--main = show <| tile [1, 1] [Nothing, Just False, Nothing, Nothing]
main = showGrid <| Maybe.withDefault grid0 <| constrainGrid rows cols grid0 `andThen`
constrainGrid rows cols `andThen`