teleren/devto huggingface dataset:
Making Phone Calls from Blazor WebAssembly with Twilio Voice
Tags: dotnet, aspnet, twilio, blazor
Published: 2020-11-30 15:50:02

---
title: Making Phone Calls from Blazor WebAssembly with Twilio Voice
published: true 
date: 2020-11-30 00:00:00 UTC
tags: dotnet, aspnet, twilio, blazor
canonical_url: https://www.twilio.com/blog/making-phone-calls-from-blazor-webassembly-with-twilio-voice
cover_image: https://swimburger.net/media/zgpdpg3u/blazor-twilio-calls-social.png?anchor=center&mode=crop&width=1000&height=420
---


Mobile phones are ubiquitous and convenient but there are times when it’s more practical to be able to receive and place phone calls from a computer. If you’ve called customer service about the tickets you ordered, or anything else, it’s likely the rep you spoke to took your call with a mouse click.

Using Twilio Voice you can add the ability to make and receive phone calls from your own ASP.NET web applications. Twilio’s helper library for JavaScript makes it easy to integrate client functionality into web front ends built with Blazor WebAssembly, and the Twilio NuGet packages provide you with convenient interfaces to Twilio’s APIs for server-side tasks.

[Blazor WebAssembly](https://docs.microsoft.com/en-us/aspnet/core/blazor/?view=aspnetcore-5.0#blazor-webassembly) lets you build your application front end in C# and Razor, so you can focus the client-side JavaScript on functionality that requires JavaScript for implementation.

[JavaScript interoperability](https://docs.microsoft.com/en-us/aspnet/core/blazor/call-javascript-from-dotnet?view=aspnetcore-5.0) (JS interop) is a feature of Blazor that makes it easy to call JavaScript APIs and libraries from your C# code.

Both these technologies are built on [.NET Standard](https://docs.microsoft.com/en-us/dotnet/standard/net-standard), so they’re available in both [ASP.NET Core 3.1](https://docs.microsoft.com/en-us/dotnet/standard/net-standard) and [ASP.NET Core in .NET 5.0](https://docs.microsoft.com/en-us/dotnet/core/dotnet-five).

In this post you’ll learn how to build a web application for making and receiving voice calls using these technologies. You’ll see how to integrate a Blazor component with the [Twilio Client JS SDK](https://www.twilio.com/docs/voice/client/javascript) and how to route Twilio calls using [ASP.NET Core WebAPI](https://docs.microsoft.com/en-us/aspnet/core/web-api/?view=aspnetcore-5.0).  You’ll also learn how to use [TwiML](https://www.twilio.com/docs/voice/twiml)™ (the  **Twi** lio  **M** arkup  **L** anguage) to tell Twilio what to do when a call comes into a Twilio phone number.

The tutorial in this post contains the complete source code and it’s provided under an MIT license so you can incorporate it into your own project.

**Continue reading at the Twilio blog: [Making Phone Calls from Blazor WebAssembly with Twilio Voice](https://www.twilio.com/blog/making-phone-calls-from-blazor-webassembly-with-twilio-voice)**
Autocommitting
Tags: showdev, bash, git, automation
Published: 2020-11-29 23:58:14


To resolve my issue for posting more progress in such major files infrequently, so my work can be published more regularly, without thinking to open GitHub Desktop, I got off the Batch mindset, shoved my brain and face into an asylum of the MSYS2 terminal testing all types of things, to make my first Shell script, dedicated to... you already read the title.

Anyway, with this script, it will help you to commit more often (if you don't already), by assigning it to a task scheduler or cron job to be run on a consistent schedule. Its usage is simply `autocmt.sh ~/Documents/repos/123/`.
This script will also name your commits by summarizing your additional changes in a compact manner.

For example, you can set this to run every day, and on other days, push your changes, which can be done by appending your command with `-p`.

Project page:
https://github.com/donnaken15/Autocommit

[Direct script file](https://raw.githubusercontent.com/donnaken15/Autocommit/main/autocmt.sh)


Warning, this was only tested with MINGW and WSL, so I don't know if it will work purely on Linux. Titles may not look the best or probably won't work AT ALL, either, but I tried, with multiple substring problems.
In total, I think this project took a third of a day, within two days.

Here's my repo I tested this script against while putting the finishing touches, it went well as you will see:
https://github.com/donnaken15/AutocmtTest/commits/master
re:Invent: Data Sessions Week 1
Tags: aws, datascience, analytics, database
Published: 2020-11-29 23:14:05

Here is my list of sessions for week one of re:Invent focussed around data and analytics.

* How to use fully managed Jupyter notebooks in Amazon SageMaker
* What’s new with Amazon S3
* How BMW Group uses AWS serverless analytics for a data-driven ecosystem
* Innovate faster with applications on AWS storage
* Embed analytics in your applications with Amazon QuickSight
* Discovering insights from customer surveys at McDonald’s
* What’s new in Amazon ElastiCache
* How FINRA operates PB-scale analytics on data lakes with Amazon Athena
* How Zynga modernized mobile analytics with Amazon Redshift RA3
* Implementing MLOps practices with Amazon SageMaker
* Break down data silos: Build a serverless data lake on Amazon S3
* Amazon DocumentDB (with MongoDB compatibility) Deep Dive
* Gameloft: A zero downtime data lake migration deep dive
* Nationwide’s journey to a governed data lake on AW
* BI at hyperscale: Quickly build and scale dashboards with Amazon QuickSight
* Building for the future with AWS databases
* How the NFL builds computer vision training datasets at scale
* What’s new in Amazon RDS
* Serverless analytics at Equinox Media: Handling growth during disruption
* Data modeling with Amazon DynamoDB – Part 1
* Dive deep into AWS Schema Conversion Tool and AWS DMS
* How Vyaire uses AWS analytics to scale ventilator production
* From POC to production: Strategies for achieving machine learning at scale
* The right tool for the job: Enabling analytics at scale at Intuit
* Secure and compliant machine learning for regulated industries
* How Disney+ uses fast data ubiquity to improve the customer experience
* Deep dive on Amazon Aurora with PostgreSQL compatibility
* Train and tune ML models to the highest accuracy using Amazon SageMaker
* How Nielsen built a multi-petabyte data platform using Amazon EMR
* How Goldman Sachs uses an Amazon MSK backbone for its Transaction Banking Platform
* Data modeling with Amazon DynamoDB – Part 2
* How Disney+ scales globally on Amazon DynamoDB
* Productionizing R workloads using Amazon SageMaker, featuring Siemens

For a full list of sessions and to register visit [https://reinvent.awsevents.com](https://reinvent.awsevents.com)
Browser has cached a 301 Moved Permanently
Tags: django, cached, moved, permanently
Published: 2020-11-29 07:26:52

---
title: Browser has cached a 301 Moved Permanently
published: true
description: 
tags: django, cached, moved, permanently
//cover_image: https://direct_url_to_image.jpg
---
I'm learning django by following the [Mozilla django tutorial](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/Tutorial_local_library_website)

At the start of the project I've edited the `urls.py` file to have 

```
urlpatterns = [
    path("admin/", admin.site.urls),
    path("catalog/", include("catalog.urls")),
    path("", RedirectView.as_view(url="catalog/", permanent=True)),
]
```
Following the tutorial all is well and then started my `lets do something myself` and did exactly same as the tutorial except having different data models and then different url path etc.
```
urlpatterns = [
    path("admin/", admin.site.urls),
    path("recipes/", include("lend.urls")),
    path("", RedirectView.as_view(url="recipes/", permanent=True)),
]
```
But this time when testing the local site by navigating to  `http://127.0.0.1:8000/` it was automatically getting redirected to `http://127.0.0.1:8000/catalog/`.
I thought may be I copied code and searched for the word `catalog` in my new project. I coudn't find anything. After spending crazy one hour wondering what is going wrong, except doing a reinstall of ubuntu, started searching for if anyone else would have the same issue?

Voilà landed in a [stackoverflow question] (https://stackoverflow.com/questions/42720459/why-does-python-django-keep-redirecting-to-another-url) someone else had exactly the same issue.
The very first line of the answer said **Try clearing your browser cache.** because  browser has cached a [301 Moved Permanently](https://en.wikipedia.org/wiki/HTTP_301) at least for those who start learning to create web apps in any framework, this is an important piece of knowledge before they clean wipe the system and reinstall everything.
Javascript regex part 4 searching for patterns in specific positions 
Published: 2020-11-29 22:50:17

**Intro**

In the previous three regex blogs we looked for matches regardless of where they were positioned. You can also look for patterns that are at specific positions in the string.

**Match patterns at the beginning/end of the string**

By using the ^ symbol (called an anchor) you can check if the string starts with a specific pattern:

```
let str = "Larry played basketball today"
let regex = /^Larry/
regex.test(str) //true
```

By using the $ symbol (also called an anchor) we can check if the string ends with a specific pattern:

```
let str = "Larry played basketball today"
let regex = /today$/
regex.test(str) //true
```
**Using both anchors**

By using both anchors you can check if a string fully matches a pattern:

```
let timeIsValid = /^\d\d:\d\d$/.test('12:05');
console.log(timeIsValid); //true
```
Setup Bulma CSS framework in your Rails application
Tags: ruby, rails, bulma, coding
Published: 2021-11-23 04:17:23

---
title: Setup Bulma CSS framework in your Rails application
published: true
date: 2020-11-29 21:40:00 UTC
tags: ruby,rails,bulma,coding
canonical_url: https://streetcoder.dev/coding/2020/11/29/rails-bulma-setup.html
---

![bulma-header](https://streetcoder.dev/static/img/posts/2020-11-29-rails-bulma-setup/bulma-header.png)

In this tutorial, I will show you how to setup the CSS framework [Bulma](https://bulma.io/) in a Rails application

**Prerequisites**

- Rails 6.x

**Create new rails project**

Go to your terminal and execute `rails new bulma-test`. You can read the guide to [Starting your Rails project with an ultra-light setup](https://streetcoder.dev/coding/2020/10/11/rails-ultra-light-setup.html)

Enter to folder project, run your application by executing `rails s`, and go to url `localhost:3000`

![rails](https://streetcoder.dev/static/img/posts/2020-11-29-rails-bulma-setup/rails-page.png)

**Setup Bulma in the project**

Install bulma package by executing `yarn add bulma`

![bulma](https://streetcoder.dev/static/img/posts/2020-11-29-rails-bulma-setup/bulma-instalation-completed.png)

Open the file `/app/assets/stylesheets/application.css`, replace all its content by

```
@import "bulma/bulma"; 

```

Finally, rename the file to `application.scss`

Ok, the setup is done, let’s try it

**Create your first rails view styled with Bulma**

Create `Home` controller and `index` view by executing this command `rails g controller Home index`.

Open the file `app/views/home/index.html.erb` and replace its content by:

```
<div class="box m-6">
  <div class="content">
    <div class="title is-2 has-text-info">Hello Bulma!</div>
    <div class="button is-success">Success</div>
  </div>
</div>

```

Open the file `config/routes.rb`, and add a route to our new view

```
Rails.application.routes.draw do
  get 'home/index'
  root 'home#index' # <- This one
end

```

Refresh the browser and you should see this page

![bulma](https://streetcoder.dev/static/img/posts/2020-11-29-rails-bulma-setup/bulma-ready.png)

That’s it!
Building a Temperature Converter in Elm and Bulma
Tags: elm, bulma, video, webapplication
Published: 2020-11-29 21:55:39

---
title: Building a Temperature Converter in Elm and Bulma
published: true
description: Building a Temperature Converter in Elm and Bulma.
tags: elm,bulma,video,webapplication
//cover_image: https://direct_url_to_image.jpg
---

Building a Temperature Converter in Elm and Bulma

Last minute change in language choice for Advent of Code this year. I was planning on doing [Elm](https://elm-lang.org/) for the 3rd year in a row, but my youngest daughter convinced me to do Roblox instead. I know Lua, and Roblox uses it for UI dev, but I don't know their API nor 3D stuff well, so it'll be a nice change of pace. SO I made [this video series](https://www.youtube.com/watch?v=g1StMI02Riw&list=PLZEZPz6HkCZkLCmyoPt1BqI_kO8BuZYYu) to "get the Elm out of my system" as it were.

{% youtube g1StMI02Riw %}
CV / Resume - Is this okay?
Tags: help
Published: 2020-11-29 21:40:22

I have entered a sort of career identity crisis period in my life - I have lived and breathed UI development for years, I love where I work, so I am applying for an internal role but this will be a role going out to clients.

Can anyone take a look at 2.1 pages of CV and tell me if what I have written is enough to catch your eye.

I know the reality of the situation, a CV is not meant to tell you what I do, its meant to tick boxes, grab your attention and say yes I will have you in for interview.

Whats been changed? This years role has been added.

**Linky:**
https://drive.google.com/file/d/1SaMlxoeerzgyO2h70xddOaGmPWoTy4lB/view?usp=sharing
Como usar o Docker sem ser root
Tags: portugues, docker, linux, freebsd
Published: 2020-11-29 21:38:28

Adicione seu usuário ao grupo 'docker':

`# vim /etc/group`

Localize a linha do grupo 'docker' e adicione seu usuário ao final, após o ':' como no exemplo:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/rpes2y3sr7ibm1gw6i02.png)

Se o grupo ainda não existe execute:

`# groupadd docker`

Para testar relogue no sistema com seu usuário ou execute o comando:

`$ su - $USER`

Para checar se deu certo

`$ id`
Getting data quickly in Ruby
Tags: codenewbie
Published: 2020-11-29 21:11:43

######Photo by <a href="/photographer/VanHeber-45289">Weber VanHeber</a> from <a href="https://freeimages.com/">FreeImages</a>

This mini post is a follow up to the *Hash-tastic!* series. 
**You can find it here:** https://dev.to/leighad/hash-tastic-part-one-1706

In that series, I presented a nested data structure and discussed how to extract the data within it. I did not use any built in Ruby methods, but instead I chose to write all the code out for purposes of learning. 

Here I would like to show a quick and easy way to use a built-in Ruby method to pull out this data. While built-in methods are quite handy and certainly can save time and lines of code, it is really important to understand what is going on behind all that 'magic'. There are so many good ones to choose from, but for this example, we will look a bit closer at Ruby's **values_at** method.

**Say you have an array:**

``` ruby
arr = ['cat', 'dog', 'bird', 'fish', 'rabbit']
```
You could get multiple non-sequential values this way:

``` ruby
x, y, z = arr[0], arr[1], arr[3]
```

Or you could just use the **values_at** method:

``` ruby
x, y, z = arr.values_at(0, 1, 3)
```

This would return the values of elements **0, 1, 3** which are **cat, dog, fish**

You can also use **values_at** with a hash:

``` ruby
candy_hash = {gummies: 5, sours: 7, chocolate: 10}
```

Here you could write:

``` ruby
candy_hash.values_at(sours:)
```

This would return the value of **sours:** which is **7**

As you can see, built-in methods can be quick and easy to use. It is tempting to grab one when you need that quick fix, but just make sure you really understand what is happening behind all that Ruby 'magic'!
Just build it
Tags: 100daystooffload
Published: 2020-11-29 21:03:22

Over the past ten years or more, I've had several ideas for personal projects. Some were to solve a business problem, others as a way to learn a different technology and some even to hedge against needing to change careers at some point in the future. Coming up with an idea is not a problem for me, especially at work. It might be seen by some as disruptive but I am often an advocate for ripping up the rule book and starting again. 

## Lazy perfectionist

Despite having lots of ideas, converting that into a working project is rare, and finishing a project is even rarer. I think that I have a mindset something like a "lazy perfectionist". I want the thing I'm producing to be perfect, but struggle to put the effort in to learn everything I need to do that, and eventually it gets replaced by my next great idea.

## Down the rabbit hole again

My idea is a set of tools that I can use at work to help us get better at capturing requirements. Just some simple utilities such as checklists with guide words, asking five whys and so on. But why not make it into a little app?

The project is small enough for me to get started and would help me develop skills that I don't have much use for at the moment. Unfortunately, I have already gone right down into the weeds with this project. Rather than just getting a form built, I decided I needed to learn about CI/CD, API design, Svelte, Tailwind, Go, etc. And that's before going down the machine learning rabbit hole for another idea I had. 

## Just build it

I was listening to a podcast lately – unfortunately I can't remember which one – and this idea came up in the conversation. The robust response to this problem is one I've heard before, but I hardly ever do it: _just build it_.

This time then, I am committing to trying to get something built. I still want to use the tools I've been practising, but I want to focus on the absolute minimum first. If I get something that works, I will allow myself to develop it further. Let's see how it goes…

_I'm publishing this as part of 100 Days to Offload. You can join in yourself by visiting [https://100daystooffload.com.](https://100daystooffload.com)_

Photo by [Danielle MacInnes](https://unsplash.com/@dsmacinnes?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/beginning?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText).
What makes good developer merch?
Tags: discuss, developermerch, merch
Published: 2020-11-29 20:55:04


Last week, my order from Dev's merch store arrived, hip hip array! I finally have some [Dev.to stickers](https://shop.dev.to/products/sticker-pack-1) 🥳 😍(The only downside of was, that I had ordered two packs, and got only one...)

This week, as I've been browsing black friday deals everywhere, I've been wondering, what makes developer merch good. Is it just the dev jokes on the merch? Or the merch itself, whether it's stickers, mugs, t-shirts or face masks? What about the color or size selection? Or (dare I even suggest this) is it the font? Or sometimes the (lack of) graphics?

What do you think? What is your favorite merch (either something you own already or something you'd like to buy)? Why is it your favorite?

Is there some merch that isn't available anywhere, but you're dreaming about it?
Win Every Words With Friends Game
Tags: gamedev, devops
Published: 2020-11-29 20:13:51

Words With Friends Cheat https://www.crosswordsolver.com/words-with-friends-cheat helps you win the game by identifying the highest-scoring words to play. The tool allows you to enter the letters in your rack, wildcards, the letters/words on the board, as well as how words should start and/or end. You can then view the number of points for each word possibility and clearly determine your best options.

We also have a Words With Friends Dictionary https://www.crosswordsolver.com/wwf-dictionary-word-checker that you can use to determine whether a word is valid or not in the game before you decide to play it.

With our WWF helpers, our goal is to help players improve their strategy, confidence, and love for the game.
Imposter syndrome & at what point did you realise you where a developer
Tags: conversation, forn00bs
Published: 2020-11-29 19:59:38

[Imposter syndrome](https://en.wikipedia.org/wiki/Impostor_syndrome) is something I have often felt in my journey to becoming a developer. 
I am self taught (mostly), and was lucky to be given a chance at a growing start up ([Strattic](https://www.strattic.com/careers/)). 
My first few weeks where filled with fake it until you make it, with many late nights and LOOOOTS of caffeine. But I after a couple of weeks I sat down with the team to show what I had achieved and I amazed myself.
I look back on that code now and laugh, and am amazed that not only does it still work but some of that code still on production (with a lot of refactors and help from much more experienced devs).
Did you have an AH HA! moment when you suddenly realised you where keeping up with the big boys?
Question about importing Java packages. (too long to put in title)
Tags: java, help, watercooler
Published: 2020-11-29 19:14:22

If I have a package called `runtdeale.code` in the folder `RuntDeale/resources/code`, could I do import `runtdeale.code.libs.org.json.*;` to import the JSON library, which is a package below my original package?


Filesystem:
```
RuntDeale:
    resources:
        textures: ...
        ...
        code:
            Main.java
            manifest.txt
            ...
            libs:
                org:
                    json:
                        /* org.json library files */
```
JavaScript | Sorting Algorithms
Published: 2020-11-29 18:57:37

# JavaScript | Sorting Algorithms

### Bubble Sort

```javascript
function bubbleSort(array) {
  // run time --> O(n^2)
  let length = array.length;

  for (let i = 0; i < length - 1; i++) {
    for (let j = 0; j < length - 1; j++) {
      if (array[j] > array[j + 1]) {
        let tmp = array[j + 1];
        array[j + 1] = array[j];
        array[j] = tmp;
      }
    }
  }
  return array;
}
```

### Insertion Sort

```javascript
function insertionSort(array) {
  // run time --> O(n^2)
  let length = array.length;
  for (let i = 1; i < length; i++) {
    let tmp = array[i];
    let currentIndex = i;
    while (currentIndex > 0 && array[currentIndex - 1] > tmp) {
      array[currentIndex] = array[currentIndex - 1];
      currentIndex--;
    }
    array[currentIndex] = tmp;
  }
  return array;
}
```

### Selection Sort

```javascript
function selectionSort(array) {
  // runtime -->  O(n^2)
  let startIdx = 0;
  let length = array.length;
  while (startIdx < length - 1) {
    let smallestIdx = startIdx;
    for (let i = startIdx + 1; i < length; i++) {
      if (array[smallestIdx] > array[i]) smallestIdx = i;
    }
    swap(startIdx, smallestIdx, array);
    startIdx++;
  }
  return array;
}

function swap(i, j, array) {
  let tmp = array[j];
  array[j] = array[i];
  array[i] = tmp;
}
```

### Quick Sort

```javascript
function quickSort(array) {
  let start = 0;
  let end = array.length - 1;
  helper(array, start, end);
  return array;
}

function helper(array, start, end) {
  if (start >= end) return;
  let pivot = start;
  let left = start + 1;
  let right = end;

  while (right >= left) {
    if (array[left] > array[pivot] && array[right] < array[pivot]) {
      swap(left, right, array);
    }
    if (array[left] <= array[pivot]) left++;
    if (array[right] >= array[pivot]) right--;
  }
  swap(pivot, right, array);
  let tmp = right - start - 1 < end - (right + 1);
  if (tmp) {
    helper(array, start, right - 1);
    helper(array, right + 1, end);
  } else {
    helper(array, right + 1, end);
    helper(array, start, right - 1);
  }
}

function swap(i, j, array) {
  let tmp = array[i];
  array[i] = array[j];
  array[j] = tmp;
}
```