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
#!/usr/bin/env elixir | |
Mix.install([{:phoenix_pubsub, "== 2.1.2"}, :phoenix]) | |
start_spec = fn(spec) -> | |
{m,f,a} = spec.start | |
apply(m,f,a) | |
end | |
{:ok, _} = Application.ensure_all_started(:phoenix_pubsub) |
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
111111111111111111111111111111 | |
100000100000000000000001000001 | |
000101001111000000111100101000 | |
101010000000100001000000010101 | |
010010000000100001000000010010 | |
100010000000011110000000010001 | |
010010000000000000000000010010 | |
101010000000000000000000010101 | |
000101000000000000000000101000 | |
100000100000000000000001000001 |
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 ExampleApp.Web.LiveAcl do | |
@moduledoc """ | |
ACL checks for LiveView | |
``` | |
use ExampleApp.Web.LiveAcl | |
``` | |
Provides an `on_mount` hook to do ACL checks on mount, for instance | |
to ensure the current user has access to a given invoice ID. |
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 MyApp.ReceiveServer do | |
@behaviour :gen_smtp_server_session | |
require Logger | |
# how many simultaneous SMTP sessions | |
@max_sessions 20 | |
# max email message size | |
@maxsize 200 * 1024 * 1024 |
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
// Use at your own risk! No support for mutations currently. | |
const createSocketLink = (socket: Socket) => { | |
const channel = socket.channel('__absinthe__:control') | |
channel.join().receive('error', () => console.error('Failed to join Absinthe channel!')) | |
return new ApolloLink(operation => { | |
return new Observable(observer => { | |
const query = print(operation.query) | |
const { variables } = operation |
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
#!/bin/bash | |
set -e | |
CARD=$(pactl list | grep bluez_card | awk -F ': ' '{print $2}') | |
A=a2dp-sink-ldac | |
B=headset-head-unit | |
PROFILE=$(pactl list |grep 'Active Profile' | tail -n 1 | awk -F': ' '{print $2}') |
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
~ | |
▶ curl -X POST https://bsqd.me/phone/webhook/736e85d2-8654-4ec5-ac53-2893e1f2b2fa/31641322599/call1 -d '{}' -H 'Content-type: application/json' | |
{"is_final":false,"locale":"en","ssml":"<speak><s>Hello this is a bot <break time=\"1500ms\"/> </s><s>What is your name?</s></speak>","tts":null,"voice":{"gender":"FEMALE","locale":"en","name":"en-GB-Wavenet-A","preview_url":"https://cloud.google.com/text-to-speech/docs/audio/en-GB-Wavenet-A.wav","type":"google"}}% | |
~ | |
▶ | |
~ | |
▶ | |
~ |
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 DynamicSupervisorDeadlockTest do | |
require Logger | |
use ExUnit.Case | |
alias Horde.DynamicSupervisor | |
setup do | |
n1 = :"horde_#{:rand.uniform(100_000_000)}" | |
{:ok, horde_1_sup_pid} = |
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 React, { useRef } from "react"; | |
import { Button, StyleSheet, View } from "react-native"; | |
import { WebView } from "react-native-webview"; | |
const userId = "myuserid"; | |
const botHost = "robin.staging.bsqd.me"; | |
export default function App() { | |
const webviewRef = useRef(); |
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
// (c) Arjan Scherpenisse 2020, License: MIT | |
package main | |
import ( | |
"context" | |
"fmt" | |
"io" | |
"io/ioutil" | |
"time" |
NewerOlder