Skip to content

Instantly share code, notes, and snippets.

View TwistingTwists's full-sized avatar
💭
Elixir dev

Abhishek Tripathi TwistingTwists

💭
Elixir dev
View GitHub Profile
@TwistingTwists
TwistingTwists / json_schema.ex
Last active February 11, 2024 06:00
instructor json schema
%{
"$defs" => %{
"Politician.Office" => %{
"description" => "",
"properties" => %{
"from_date" => %{"format" => "date", "title" => "from_date", "type" => "string"},
"office" => %{
"enum" => ["president", "vice_president", "governor", "congress", "senate"],
"title" => "office",
{
:error,
%Ash.Error.Invalid{
__exception__: true,
changeset: #Ash.Changeset<api: PyqRatta.Databank, action_type: :update, action: :update_quiz_with_question_ids, attributes: %{}, relationships: %{questions: [{[%{id: "1085ee61-68b6-4bb8-ad7c-375b7129443f"}, %{id: "d86052e1-8feb-420b-92ce-17f5d35d9c07"}], [ignore?: false, on_missing: :ignore, on_match: :ignore, on_lookup: :relate, on_no_match: :error, eager_validate_with: false, authorize?: true, meta: [inputs_was_list?: true, id: :question_ids], type: :append]}]}, arguments: %{question_ids: ["1085ee61-68b6-4bb8-ad7c-375b7129443f", "d86052e1-8feb-420b-92ce-17f5d35d9c07"]}, errors: [%Ash.Error.Invalid{errors: [%Ash.Error.Query.Required{field: :question_id, type: :argument, resource: PyqRatta.Databank.Question, changeset: nil, query: nil, error_context: [], vars: [], path: [], stacktrace: #Stacktrace<>, class: :invalid}], stacktraces?: true, changeset: nil, query: #Ash.Query<resource: PyqRatta.Databank.

Here are the few questions we will answer in the talk.

  1. Why do you need concurrency at all?
  2. What is difference between concurrency and async programming? Are not those two things same?
  3. When do you need async? Language level vs library level features.
  4. Composing futures
  5. What makes concurrency hard?
  6. Models of thread based concurrency?
  7. Actor based models of concurrency - Elixir / Scala
defmodule RazorNewWeb.RemoteUploadLive do
use RazorNewWeb, :live_view
@defaults %{
# default params for upload in liveview
# 4000 MB
max_file_size: 4000 * 1000 * 1000,
chunk_size: 640 * 1000 * 3,
accept_upload_types: ~w( .mp4 ),
This file has been truncated, but you can view the full file.
openapi: 3.0.0
info:
contact:
name: Zoom Developers
url: https://developer.zoom.us/
description: "The Zoom Meeting API lets developers access information from Zoom.\
\ You can use this API to build private services or public applications on the\
\ [Zoom App Marketplace](http://marketplace.zoom.us). To learn how to get your\
\ credentials and create private/public applications, see our [OAuth](https://developers.zoom.us/docs/integrations/oauth/)\
\ documentation. \n\nAll endpoints are available via `https` and are located at\
This file has been truncated, but you can view the full file.
{"openapi":"3.0.0","info":{"contact":{"name":"Zoom Developers","url":"https://developer.zoom.us/"},"description":"The Zoom Meeting API lets developers access information from Zoom. You can use this API to build private services or public applications on the [Zoom App Marketplace](http://marketplace.zoom.us). To learn how to get your credentials and create private/public applications, see our [OAuth](https://developers.zoom.us/docs/integrations/oauth/) documentation. \n\nAll endpoints are available via `https` and are located at `api.zoom.us/v2/`. For example, to list all of an account's users, use the `https://api.zoom.us/v2/users/` endpoint.","termsOfService":"https://zoom.us/docs/en-us/zoom_api_license_and_tou.html","title":"Zoom Meeting API","version":"2.0.0"},"servers":[{"url":"https://api.zoom.us/v2"}],"paths":{"/accounts/{accountId}/managed_domains":{"get":{"parameters":[{"description":"The account's ID. For the Master account, pass the `me` value for this parameter.","in":"path","name":"accountId","req
@TwistingTwists
TwistingTwists / cenc.proto
Created March 18, 2023 09:04
testing widevine
// Copyright 2016 Google Inc. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file or at
// https://developers.google.com/open-source/licenses/bsd
//
// This file defines Widevine Pssh Data proto format.
syntax = "proto2";
@TwistingTwists
TwistingTwists / main.go
Created March 11, 2023 05:01
drm server
package main
import (
"bufio"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
@TwistingTwists
TwistingTwists / README.md
Created March 10, 2023 11:05
golang CORS allowed http server with static file serve

run it via

go run main.go from the directory you want to server static files from .