teleren/devto huggingface dataset:
Find Valid Phone Numbers, Anywhere!
Tags: api, phone, numbers
Published: 2020-04-10 02:04:10

This small react project uses [TCXC API](https://documenter.getpostman.com/view/5344044/SVtbPk6K?version=latest#e3ab2e21-a698-452f-b0ef-d59872dbafba) to get valid phone numbers anywhere in the world. Just pass any country prefix (CC+Area Code) and the API will give you a few random numbers. It'll give you more numbers each time to you click "Get More".

LIVE DEMO: https://tools.telecomsxchange.com 

# Install & Customize Locally 


## Backend SERVER APP

Local Setup

- Clone the project
- run command: yarn 
- run command: TELE_USER_NAME=BUYERUSERNAME TELE_USER_PASSWORD=API-KEY node app.js
- run command: yarn start

## Deploy to Heorku


- git clone the repo
- cd /react-apps-getnumbers
- create app on heroku http://heroku.com 
- heroku git:remote -a app-name (check this on heroku page)
- git push heroku master
- set config vars on heroku 

In Terminal:
Command: heroku config:set TELE_USER_NAME={TelecomsXchange Username}
Command: heroku config:set TELE_USER_PASSWORD={TelecomsXChange API Key}

To make sure variables are correct set:

run command: heroku config



## FRONTEND APP

1. create .env by copying .env.example 
2. Set the backend environment variable URl (For the backend)


* run this command or put this in package.json


### Deploy Front end to Netlify

- cd to the project root
- Update the .env URL variable to the public backend URL
- run command: yarn
- run command: yarn build
- cd build
- Deploy to Netlify


### Rebranding


To rebrand this app using your logo and own favicon, follow below steps:

- rename your company logo to logo.png
- drag and drop it to the src folder
- generate a favicon from your logo at http://favicon-generator.org
- download favicon and rename it to favicon.ico 
- drag and drop favicon.ico in /public folder
- run command: yarn build
- deploy to Netlify
Trustless, privacy preserving surveillance system with AI capabilities
Tags: opensource, privacy, trustless
Published: 2020-04-10 01:56:55


Are you holding back on installing home automation in your house, because it requires cloud account sign up and you are not quite sure what happens with your data that goes to the cloud?

I was hit by the same hesitation after I played with Ring, Nest, Arlo and a few other plug-and-play cloud camera systems. The AI capabilities makes them very attractive, but the fact that I have to use a cloud API to download video footage recorded by cameras in my own home, does not sit well with me.

Why can't I get access to my local video camera stream directly on my local network, get a private and secure notification to my mobile app. Look at the AI detected object, pet or a person and make an informed decision what to do next? That should be possible without trusting a man-in-the-middle system to see, but not look at my data, right? 

Absolutely! When I asked the question first a few months ago, it was not that obvious, but after a bit of tinkering it all worked out just as expected. The result is now available for everyone else who wants a trustless, privacy preserving surveillance system with AI capabilities. Check it out: https://github.com/ambianic

There is a [5 minute quick start guide](https://docs.ambianic.ai/users/quickstart/) to get you going, if you don't have time to browse the code now.

And if you'd like to read more how it works, follow this link:
https://blog.ambianic.ai/2020/02/05/pnp.html
Privacy Preserving Home Surveillance with AI, Pi and WebRTC
Tags: ai, python, webrtc, raspberrypi
Published: 2020-04-10 01:39:36

Home surveillance systems are now mainstream. Easy to setup and easy to use. Mobile app to see who is at the door. Cloud backup for a subscription fee. All great. Except that privacy issues are getting out of control. In an article for WebRTCHacks, I cover the technical design and implementation of a solution that leverages WebRTC to prevent sensitive data storage on devices that aren’t directly controlled by the user.

https://webrtchacks.com/private-home-surveillance-with-the-webrtc-datachannel/
How To Make and Receive calls using any Programming language ?
Tags: api, voice, phone, node
Published: 2020-04-10 01:08:33

# Programmable Voice API

Learn how to make and receive phone calls programmatically using Restcomm API (Twilio Alternative) where you can use / bring your own carrier.

A Call represents a connection between a phone or user agent and Restcomm CPaaS. This may be inbound or outbound. The Calls list resource represents the set of phone calls originated and terminated from an account.

```shell

curl -X POST https://cloud.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Calls.json  \
   -d 'From=16175551212' \
   -d 'To=16172221212' 
   -d 'Url=https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/restcomm/demos/hello-play.xml' \
   -u 'YourAccountSid:YourAuthToken'


```  

### Making and receiving a call in JAVA

```java
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import java.io.*;
import java.util.Base64;

public class JavaSampleClass {
   // Provide your Account Sid and Auth Token from your Console Account page
   public static final String ACCOUNT_SID = "my_ACCOUNT_SID";
   public static final String AUTH_TOKEN = "my_AUTH_TOKEN";


   public static void main(String[] args) throws Exception {
      String userAndPass = ACCOUNT_SID + ':' + AUTH_TOKEN;
      String encoded = Base64.getEncoder().encodeToString(userAndPass.getBytes());

      URL url = new URL(("https://cloud.restcomm.com/restcomm/2012-04-24/Accounts/" + ACCOUNT_SID + "/Calls.json");
      HttpsURLConnection conn = (HttpsURLConnection)url.openConnection();
      conn.setRequestProperty("Authorization", "Basic " + encoded);
      conn.setRequestMethod("POST");
      conn.setDoOutput(true);
      DataOutputStream os = new DataOutputStream(conn.getOutputStream());

      // Update POST parameters accordingly
      os.writeBytes("From=16175551212&" +
        "To=16172221212" +
       "Url=https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/restcomm/demos/hello-play.xml");
      os.close();

      // Add your business logic below; response code can be obtained from 'conn.getResponseCode()' and input stream from 'conn.getInputStream()'
      ...
  }
}

``` 



You can also provide a list of events you are interested in getting notified on and provide a URL to receive them at. Here’s an example for receiving answered and completed events. The callbacks will be made at http://status.callback.url

```shell

curl -X POST https://cloud.restcomm.com/restcomm/2012-04-24/Accounts/ACCOUNT_SID/Calls.json  \
   -d 'From=16175551212' \
   -d 'To=16172221212' \
   -d 'Url=https://ACCOUNT_SID:AUTH_TOKEN@mycompany.com/restcomm/demos/hello-play.xml' \
   -d 'StatusCallbackEvent=answered,completed' \
   -u 'YourAccountSid:YourAuthToken'

```  

For detailed and updated docs, visit https://cloud.restcomm.com/docs/api/calls-api.html
Streaming on Twitch!
Tags: livecoding, crystal, api, streaming
Published: 2020-04-10 00:54:10

I've been streaming for the past few weeks and really, really enjoying it! [Last week](https://www.youtube.com/watch?v=t453Bf4g0gQ) I started with a [Crystal](https://crystal-lang.org/) app called [cprox](https://github.com/arschles/cprox) and ended up with a compile error I couldn't figure out.

This week, I figured it out! I'm gonna show how I fixed it and then dive into some functional programming (as you'd probably expect if you know me well enough =P) and maybe some testing, if time allows.

Hope to see you there at 10am Pacific Time!

[twitch.tv/arschles](https://twitch.tv/arschles)
Simple and Effective Collision Resolution of an Axis Aligned Bounding Box to an Immovable Plane
Tags: physics, gamedev
Published: 2020-04-10 00:47:43

Recently here at Wooden H Studio we have uncovered a way to create some simple Axis Aligned Bounding Box, or AABB for short, to plane resolution, so let’s get started with how we did it!

## Standard Variables
As a standard AABB’s have a couple variables that when added together create an AABB, these include a position, and minimum value, a maximum value, additionally we made a simple plane that consists of a position, and a normal vector. So, let’s assume we already know that the AABB and the Plane are colliding and now we need to figure out how to move the AABB back up to where it isn’t inside the plane.

## The Calculations
What we did is we started off by using the closest point to a line test. Originally, we didn’t have a line to use so we needed to make one. We used the normal value of our plane and added it to the plane's position to give us the endpoint for our line, this way the plane could be facing any direction and we will always have a valid line to start. From here you can find the closest point using the closest point on a line test. To do this test you need to subtract the lines end position by the lines starting position and normalize it, I’ll call this the "Start To End" vector. Then you take the point you are trying to find, in this case, it is the AABB’s position, and subtract it by the lines start position. Next, we want to find the dot product of both of these values and multiply it with the "Start To End" vector. Lastly, we need to add this new vector to the plane's position and that is how you find the closest point!

Next up we need to find the extents of the AABB, which is simply the AABB’s maximum value subtracted by its position and that will give us the extents of our cube. We can use the extents to get a radius in coherence with the plane. To get this radius we once again use the dot product with the planes normal vector and our extents.
 
So now that we essentially have the AABB’s position projected onto our line and we have the "radius" of our cube all that is left is to perform a distance check. We can use the distance formula to see how far our closest point on the line is from the plane's position. From here we need to find how much overlap occurs between the plane and the AABB, well we have the distance the object is from the plane, and we have the "radius" of the cube, and we know the object is already colliding, so we can take the radius and subtract the distance from it to get the overlap. Now you can multiply this overlap by the planes normal and that will give you the force needed to keep it above the plane and not colliding with it, and that is how we have done AABB to Plane Resolution.

By Gage Dietz
Deploy your frontend in 15 seconds with Zeit Now
Tags: frontend, webdev, zeit
Published: 2020-04-10 00:22:11

---
title: Deploy your frontend in 15 seconds with Zeit Now
description: Experience blazing fast deploys to your website, free for personal with SSL. 
keywords: zeit, frontend deployment,frontend, website deploy, free
author: Ayush Chauhan
stats: paragraph=3 sentences=6, words=38
---

When I started deploying my frontends and stactic sites on zeit, I've never looked back. Zeit offers fast and zero config deployments and is my go to platform for frontend deployment.

![staticzeit.jpg](https://blog.heyayush.live/static/3a375e8c2f61cea65eb7ac1c1c4b90dc/ebf7c/staticzeit.webp)

*(Alt-Text- [zeit.co](https://zeit.co) homepage, Develop, Preview, Ship)*

## **Why Zeit?**

- Free for personal use
- Instant static deploys
- Zero Config Required
- Collaborative
- Automatic SSL
- Blazing Fast

## **Requirements**

- [Node.JS](https://nodejs.org) and npm / yarn

## Let's go

- Create a Account on [zeit.co](https://zeit.co)

    Tip : Go to [zeit.co](https://zeit.co) on your phone and add the page to home screen for instant experience on mobile.

- Go to your Terminal and Install **Now** command line tool.

    ![zietnow.jpg](https://blog.heyayush.live/static/7e31946746dfa5fb1186e4aac8e94017/7d801/zietnow.webp)
    *(Alt-Text- [zeit.co](https://zeit.co) homepage, download zeit CLI)*

        npm i -g now

- What is **now**? 
Now command-line interface enables instant cloud deployment and local development.

- Navigate to your project and deploy files.

    ![zeitnow.gif](https://blog.heyayush.live/b349dedd9b3ecca15da91e2ca2c67fa0/zeitnow.gif)
    *(Alt-Text- Me executing all steps)*

1. Make sure there is `index.html` in your folder. 
2. Open your terminal at root of the folder you want to deploy.
3. execute `now login` to authenticate your cli with your id.
4. type `now`.

---

That's it; Yep just that; all you need is `now`
online&offline
Published: 2023-08-04 06:04:18

---
title: online&offline
published: true
date: 2020-04-10 00:00:00 UTC
tags: 
canonical_url: https://manon.icu/blog/apis/online-offline
---

> 当浏览器从在线与离线状态中切换时，这两个事件会在页面的 body 上触发，并冒泡到 document 和 window。可使用 window、document、document.body、添加监听事件`addEventListener`。

## 使用方法

```js
//网络状态
window.addEventListener('load', () => {
  const updateOnlineStatus = () => {
    this.online = navigator.onLine
  }

  window.addEventListener('online', updateOnlineStatus)
  window.addEventListener('offline', updateOnlineStatus)
})
```
Terminators on Tech - TerminusDB Internals
Tags: database, rust, prolog, backend
Published: 2020-04-09 23:42:58

---
title: Terminators on Tech - TerminusDB Internals
published: true
description: As enthusiastic Terminators, we all want to know how TerminusDB works. We want to know how with Prolog and Rust it works like magic: provide functions like git, allows rollback, branch and merge. In this webinar, we will ask our BDFL Gavin Mendel-Gleason -- creator of TerminusDB, technical and no so technical questions about TemrinusDB internals.
tags: Database, Rust, Prolog, Backend
---
As enthusiastic Terminators, we all want to know how TerminusDB works. We want to know how with Prolog and Rust it works like magic: provide functions like git, allows rollback, branch and merge. In this webinar, we will ask our BDFL Gavin Mendel-Gleason -- creator of TerminusDB, technical and no so technical questions about TemrinusDB internals.
More time, less focus 20 DAYS in complete LOCKDOWN!
Tags: discuss, motivation, beginners, showdev
Published: 2020-04-09 23:41:29

## My Story In Lockdown

It's my 20th day at home in complete lock down where am currently located. I started out motivated and exited to work on projects ideas and backlog that I don't usually have time for. 

Half way through the lockdown, on the 10th day to be specific. I started to lose focus and motivation to code or do any work, it wasn't because of lack of time, or any external source of stress for sure. The feeling lasted about 4-5 days, with no energy or motivation to do anything, so I ended up eating more and watching stuff (not tech), in a few days my brain adapted again and got motivated to continue working with great level of energy and motivation.

## Take Away

The reason am sharing this is because I realized that some people are located in different parts of the world where the complete lock down just started, if you face the same issue within first 10 days of stay home full time. Don't worry! the good news is that you will be fine a few days later. So don't feel bad about it, just sit back and enjoy the time away from the work until you feel like jumping back in with full power.

### How are you feeling ?

What is your experience coding in lock down ? how many days have you been at home and how are you feeling? Would love to hear about others experiences working as developers during lock down.
How to learn Linux from basic to pro?
Tags: linux, ubuntu, beginners
Published: 2020-04-09 23:31:22

I really want to dive deep into learning Linux and I am really serious and dedicated into this. I have installed Ubuntu to my desktop and replaced my windows 10. I am currently waiting for new laptop and install Ubuntu there too. 

What I want to know is that, can anyone give me an advice step by step on what to learn first and what to learn next? I want to use Linux in everything, like building website, setting up servers, and many more.
COVID-19 stats - Phone Call
Tags: twiliohackathon
Published: 2020-04-09 23:19:43

---
title: COVID-19 stats - Phone Call
published: true
description: My submission to the Twilio x DEV Hackathon!
tags: twiliohackathon, #twiliohackathon 
---

## What I built

I built a voice response application that uses Twilio's voice API. It asks users for a country or continent, then responds with the number of total cases, along with total deaths. After that, it gives the user a positive message.

## Demo Link

https://drive.google.com/file/d/1bSIk4ymVGnLZTVC9wZGoWvu74F_KKzA8/view?usp=sharing

## Link to Code

https://github.com/mioppong/twilio_hackathon


Okay so I have recently been taking online courses in the data science field as I am graduating from comp sci soon, I am hoping to focus within this area. I made NBA predictor, and which scraped a basketball stat website, and thought I could apply the same logic here.

TIMELINE ON HOW I BUILT MY PROJECT

- I follow about 1000 Twilio tutorials in python to see how things work

- I make my own Twilio app to tell my little brother to go to sleep when its too late

-  Then use the app I made to tell my brother to go to sleep and turn it into an answering one. 

- I scrape the https://www.worldometers.info/coronavirus/ for info on how countries are dealing with corona

- make an app which asks users for specific countries, and I respond with the total cases and total deaths in that country

## ISSUES

- some issues I had, was the voice Twilio API not being able to recognize my voice saying certain countries. Apart from that, everything went bless!!

- another major issue I had during this project, was the website https://www.worldometers.info/coronavirus/ constantly updating their website, so I had to change the way I scraped the table with all the information.


## What I learned

- Now I understand the backend, when I call the bank and they say "in a couple of words, say the reason why you called"




## Additional Resources/Info 
big s/o to Twilio
big s/o to dev.to
https://www.worldometers.info/coronavirus/
List of fun Github repo
Tags: watercooler
Published: 2020-04-09 21:19:57

Sometimes, I would build random things just for fun. So I was wondering what other people have made just for joy when they are bored. Recently, out of curiosity, I hunt down all weird, funny Github repos to see what people build just for fun.

#### 1. Ohshitgit

I have to admit that the number of times I have to do a hard reset is a lot. Git is easy to use, and it is also easy to stuff things up, especially when you are new to Git. The repo is inspired by a great [website](https://ohshitgit.com) that I usually visit when I did something wrong with Git.

{% github whatthefoo/ohshitgit %}


#### 2. Fuckitjs

This is hands-down the funniest Javascript repo I have ever found on Github. Base on the Readme, Fuckitjs will try to evaluate your Javascript code and slice all lines of code that contains errors. I'm sure this would be an excellent thing for error-free codebase by removing all. I think I can use Fuckitjs for April fool for my next prank. 
{% github mattdiamond/fuckitjs %}

I'm sure that if I start using it, Fuckitjs will probably skip all my code.

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

#### 3. Bearfondle
Bearfondle is used for decode and encode a string based on the [weird part of JavaScript](https://github.com/denysdovhan/wtfjs#its-a-fail). Recommended for April Fool.

{% github MrTarantula/beardfondle %}


#### 4. Frybits-wtf

This repo is exclusively for Kotlin but I like how the author is sicked of getting the common error message. In case you didn't know, this should not be used in production.

{% github pablobaxter/frybits-wtf %}

#### 5. Brototype 👉🏼 [link](https://github.com/letsgetrandy/brototype)

Bro do you even code?
Accessing a nesting object will include a lot of null checks which makes the code ugly. So Brototype is used to access nested field inside an object. The downside of this package is that it is too funny for production use.


```Javascript
if(Bro(object).doYouEven('lift') === Bro.TOTALLY) {
    console.log(object.lift);
}
// Calling nested functions if present
Bro(object)
    .iDontAlways('goToGym')
    .butWhenIdo(function(isGymClosed) {
        console.log('The gym is closed: ', isGymClosed);
    });
```
{% github letsgetrandy/brototype %}

#### 6. Fartscroll

***Warnings***: This is not recommended to use this for your personal website. This will inject a fart noise to your page. Every time you scroll, it will play that sound based on how many pixels you have scrolled.

```Javascript
// Fart every 1 pixels scrolled - Don't do this
fartscroll(1);
```

{% github theonion/fartscroll.js %}

#### Thanks
Comment bellow if you found any fun, weird Github repo. Stay safe and stay home.
What’s your alternative solution? Challenge #17
Tags: challenges, discuss, javascript, codenewbie
Published: 2020-04-09 22:42:37

# About this series

This is series of daily JavaScript coding challenges... for both beginners and advanced users.

Each day I’m gone present you a very simple coding challenge, together with the solution. The solution is intentionally written in a didactic way using classic JavaScript syntax in order to be accessible to coders of all levels.

Solutions are designed with increase level of complexity.

## Today’s coding challenge

```
Create a function that will find the nth Fibonacci number using recursion

```

(scroll down for solution)

## Code newbies

If you are a code newbie, try to work on the solution on your own. After you finish it, or if you need help, please consult the provided solution.

## Advanced developers

Please provide alternative solutions in the comments below. 

You can solve it using functional concepts or solve it using a different algorithm... or just solve it using the latest ES innovations.

By providing a new solution you can show code newbies different ways to solve the same problem.

## Solution

```javascript
// Solution for challenge15

function findFibonacci(n)
{
    if (n == 0)
        return 0;
        
    if (n == 1)
        return 1;
        
    return findFibonacci(n - 1) + findFibonacci(n - 2);
}

var n = findFibonacci(10);
println(n);

```


To quickly verify this solution, copy the code above in this coding [editor](https://codeguppy.com/code.html) and press "Run".

> Note: The solution was originally designed for [codeguppy.com](https://codeguppy.com) environment, and therefore is making use of `println`. This is the almost equivalent of `console.log` in other environments. Please feel free to use your preferred coding playground / environment when implementing your solution.