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
// | |
// RecordAudio.swift | |
// | |
// This is a Swift class (updated for Swift 5) | |
// that uses the iOS RemoteIO Audio Unit | |
// to record audio input samples, | |
// (should be instantiated as a singleton object.) | |
// | |
// Created by Ronald Nicholson on 10/21/16. | |
// Copyright © 2017,2019 HotPaw Productions. All rights reserved. |
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 Wrangler.Application do | |
# See https://hexdocs.pm/elixir/Application.html | |
# for more information on OTP Applications | |
@moduledoc false | |
use Application | |
@registry Registry.MongoConnectionRegistry | |
@impl true |
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
%{ | |
"__v" => 0, | |
"_id" => #BSON.ObjectId<63937fbee42d79b14046ad0f>, | |
"access_restriction_data" => 32, | |
"ambr" => %{ | |
"downlink" => %{"unit" => 3, "value" => 1}, | |
"uplink" => %{"unit" => 3, "value" => 1} | |
}, | |
"imsi" => "001010000000004", | |
"network_access_mode" => 0, |
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
# Find eligible builder and runner images on Docker Hub. We use Ubuntu/Debian instead of | |
# Alpine to avoid DNS resolution issues in production. | |
# | |
# https://hub.docker.com/r/hexpm/elixir/tags?page=1&name=ubuntu | |
# https://hub.docker.com/_/ubuntu?tab=tags | |
# | |
# | |
# This file is based on these images: | |
# | |
# - https://hub.docker.com/r/hexpm/elixir/tags - for the build image |
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 ChessPhxWeb.MatchMainLive do | |
@moduledoc """ | |
List all orgs for the current_user. | |
""" | |
use ChessPhxWeb, :live_view | |
@impl true | |
def mount(_params, _session, socket) do | |
case Chex.new_game() do |
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
import SwiftUI | |
struct PinEntryView: View { | |
var pinLimit: Int = 4 | |
var isError: Bool = false | |
var canEdit: Bool = true | |
@Binding var pinCode: String | |
private var pins: [String] { |
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
let Uploaders = {} | |
Uploaders.S3 = function (entries, onViewError) { | |
entries.forEach(entry => { | |
let xhr = new XMLHttpRequest() | |
onViewError(() => xhr.abort()) | |
xhr.onload = () => (xhr.status === 200 ? entry.done() : entry.error()) | |
xhr.onerror = () => entry.error() | |
xhr.upload.addEventListener("progress", event => { | |
if (event.lengthComputable) { |
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 SimpleS3Upload do | |
@moduledoc """ | |
Dependency-free S3 Form Upload using HTTP POST sigv4 | |
https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-post-example.html | |
""" | |
@doc """ | |
Signs a form upload. | |
The configuration is a map which must contain the following keys: | |
* `:region` - The AWS region, such as "us-east-1" |
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
# Stop all containers | |
docker stop `docker ps -qa` | |
# Remove all containers | |
docker rm `docker ps -qa` | |
# Remove all images | |
docker rmi -f `docker images -qa ` | |
# Remove all volumes |