This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Finch.start_link(name: MyFinch) | |
url = "https://horizon.stellar.org/accounts/GAFNBDOZBFUKHB4ZY5ANCQ25PM33YLTMWQKW25J7LXNZM3YSHRH3BELY/transactions?limit=200&cursor=119456526699307008&include_failed=true" | |
Finch.build(:get, url, [{"Accept", "text/event-stream"}]) | |
|> Finch.stream(MyFinch, nil, fn | |
{:status, status}, _acc -> | |
IO.inspect(status) | |
{:headers, headers}, _acc -> | |
IO.inspect(headers) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defmodule RequestHelper do | |
@moduledoc """ | |
Reference from https://gist.github.com/avdi/7990684 | |
Stream download large file from url | |
""" | |
require Logger | |
@doc """ | |
Get stream data from url | |
mode could be `:binary` or `:line` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://unpkg.com/plyr@3/dist/plyr.css"> | |
<link rel="stylesheet" href="./style.ccs"> | |
<script src="https://cdn.jsdelivr.net/npm/hls.js"></script> | |
<script src="https://unpkg.com/plyr@3"></script> | |
<script src="./plyr-hls.js"></script> | |
<div class="container"> | |
<video controls crossorigin playsinline> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remember: import UserNotifications | |
func sendNotification(title: String, body: String = "") { | |
let content = UNMutableNotificationContent() | |
content.title = title | |
if body.count > 0 { | |
content.body = body | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct PlaceHolderTextEditor: View { | |
let placeholder: String | |
@Binding var text: String | |
var body: some View { | |
ZStack(alignment: Alignment(horizontal: .leading, vertical: .top)) { | |
if text.isEmpty { | |
Text(placeholder) | |
.foregroundColor(Color(.label)) | |
.padding(.top, 10) | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file should be empty and its permission should be 600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IO.puts("I'm here! Sleeping for 2 seconds") | |
Process.sleep 2_000 # waiting for the other node | |
nodes = MapSet.new([:app@app1, :app@app2]) | |
other_node = | |
nodes | |
|> MapSet.delete(Node.self()) | |
|> MapSet.to_list() | |
|> List.first() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM elixir:1.9.1-alpine as build | |
ENV MIX_ENV=prod | |
WORKDIR /build | |
RUN apk add --no-cache build-base nodejs yarn && \ | |
mix local.hex --force && \ | |
mix local.rebar --force |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# last three commits | |
git format-patch -3 --stdout > multi_commit.patch | |
# all commits that are in your branch and not in master into a single patch file multi_commit.patch | |
git format-patch --signoff master --stdout > multi_commit.patch | |
# create patches in the folder ~/output/directory/ for all commits that are in your branch and not in master | |
git format-patch -o ~/output/directory/ --signoff master |
NewerOlder