teleren/devto huggingface dataset:
Node.js code injection with nodelive
Tags: debug, live, node
Published: 2020-04-10 10:58:35

This is a small tutorial on how to debug your any Node.js program from your preferred editor.

You will be able to open a Node.js 'shell' to stop your program at some point of the code.

First, install `nodelive`:

```sh
$ npm i -s nodelive
```

Second, import the package:

```js
const nodelive = require("nodelive")
```

Finally, open the editor:

```js
await nodelive.editor({
  custom: "vars"
})
```

And boom!!! You are inside.

To output things by console, you con log them or return them.

You can use `await` directly, no need to wrap the code in the editor, which is very handy.

To get out and continue your program, just save the file automatically opened, empty.

And three more notes.

- The `await` keyword will make the debugging blockant.
- It will try to open [Sublime Text](https://www.sublimetext.com/) by default. To configure this, set the variable:
```js
nodelive.PREFERRED_EDITOR = 'brackets'
```
- The docs of the project are here:
[https://github.com/allnulled/nodelive](https://github.com/allnulled/nodelive). You will find other utilities inside, like asking for strings or option selectors, things like that.
Launching my first Saas Product
Tags: launch, saas, django, deployment
Published: 2020-04-10 11:02:36

---
title: Launching my first Saas Product
published: true
description: Today I'm launching PyHost, a Django deployment and hosting system that keeps you in control
tags: launch, saas, Django, deployment
canonical_url: https://angusallman.com/blog/pyhost-launch/
cover_image:  https://dev-to-uploads.s3.amazonaws.com/i/lloo5fl5al3m1pl9kteb.png
---

# What is it?
In short, PyHost is a server provisioning tool for Django apps. Basically, it gets your Django apps deployed in minutes with no need to even touch the command line. It can create a new server for you or connect to an existing one, install everything you need to host Django apps, and manage your sites, SSH keys, environment variables and databases. Whether you have a new domain or just want to use a subdomain is up to you but PyHost accommodates both.

# Why did I build it?
I've played with a load of web frameworks over the years and always had a bit of a soft spot for Django. I spent MONTHS building an app with a Django API but when it came to deploying it I just couldn't. It took me weeks of learning about Linux servers and Apache and SSH and a number of other technologies which, for someone new to Sys-Admin, were incredibly intimidating to even get anywhere close to having a setup I was happy with and that wasn't breaking constantly. 

Over the next year I naturally absorbed information about servers and deployment through my job at an agency called [Purr Group](https://purrgroup.com). I then decided that I'd had enough of messing around with servers and it taking hours to deploy a site so I built PyHost (which meant messing around with servers and spending countless hours deploying sites for over a year, but it felt worth it!).

# Who is it for?
I've built PyHost for absolutely anyone who uses Django (and maybe Flask too in the future - but that's a whole different blog post). It makes deploying your very first Django application a breeze but also saves more experienced developers time by taking care of the boring stuff so they can spend more time on what they want to be doing - building.

# How can I use it?

To use it, head to [pyhost.io](https://pyhost/io) and click on 'Sign up now!'. The docs are located at [docs.pyhost.io](https://docs.pyhost.io) and should contain most information you need to get going! I'm also happy to answer any questions either here in the comments, or via email at [admin@pyhost.io](mailto:admin@pyhost.io)

Leave any comments below, I can't wait to hear what people think!
How to run a Shell command in RCPTT
Tags: rcptt, eclipse, execprocess, external
Published: 2020-04-10 10:56:20

There are several reasons to run an external process when writing automated test cases. Those are some examples:
* Unzip files
* Run a script or batch file
* Access to the processes that are running on the system
* Create folders and files

Basically, to execute a system command, we use <code>exec-process</code> ECL command provided by RCPTT and pass the required parameters. Once executed, the command provides the following information:
* Exit code
* Stdout
* Stderr

The executed command depends on the operating system we are using. In our case, it is Windows so we have to pass the command as argument to cmd.exe shell.

###Create a new folder
```
exec-process cmd "/c" md "C:\\temp\\new_folder" -ignoreExitCode –ignoreStderr
```
The parameters <code>ignoreExitCode</code> and <code>ignoreStderr</code> are added in this case to ignore any failure if for example, there is already a folder with the same name.
###Unzip files
```
let [val unzipCmd [concat "\"C:\\Program Files\\7-Zip\\7z\"" " x " "C:\\temp\\output.zip" " -aoa -oC:\\temp\\new_folder"]] {
	exec-process cmd "/c" $unzipCmd
} 
```
###Windows processes
```
// check if a given windows process is running
proc processExists [val name] {
	exec-process cmd "/c" tasklist "/FI" [concat "IMAGENAME eq " $name] | get stdout | invoke contains $name
}
processExists "rcptt.exe" | verify-true
```
Designed landing page for my idea - NPM modules marketplace
Tags: javascript, npm
Published: 2020-04-10 10:18:04

---
title: Designed landing page for my idea - NPM modules marketplace
published: true
description: 
tags: javascript, npm
---

Hey guys,
I started working on an idea few days back - it is a marketplace for private npm packages so that developers can sell their code as a npm package.

Website: https://privjs.com (inspired by npmjs, priv stands for private)

Functionality:
1. Developers can simply publish their repositories to privjs.
2. If the users purchase the repo, then he can simply `npm install` the package with the auth token.
3. If the user hadn't purchased the library then he would be denied access to the code.

Any thoughts? Feedback greatly appreciated.

Thank you
Concepts frontend developers need in 2020
Tags: html, beginners, javascript, css
Published: 2020-04-10 10:14:24

Amidst this lockdown, here are some web development concepts that will be helpful for frontend developers in 2020 .
Hope you find it helpful !
PS: The slides are in no particular order.
![slide1](https://dev-to-uploads.s3.amazonaws.com/i/cbgtwdn5ogkw48qxxepf.png)
![slide2](https://dev-to-uploads.s3.amazonaws.com/i/rh3svno27ncz7uylqcw9.png)
![slide3](https://dev-to-uploads.s3.amazonaws.com/i/zb5knmyqjat4uomxmbc4.png)
![slide4](https://dev-to-uploads.s3.amazonaws.com/i/e4g510q2ozelmehfl350.png)
![slide5](https://dev-to-uploads.s3.amazonaws.com/i/b1ocdslvot60vele2tgd.png)
![slide6](https://dev-to-uploads.s3.amazonaws.com/i/afggzyhn7ckiilr1tu24.png)
![slide7](https://dev-to-uploads.s3.amazonaws.com/i/235ljbstt101smc52iot.png)
vuejs with crypto-js - AES256 encrypt | decrypt api login
Tags: vue, cryptojs
Published: 2020-04-10 09:58:31

---
title: vuejs with crypto-js - AES256 encrypt | decrypt api login
published: true
description: vuejs with crypto-js - AES256 encrypt | decrypt api login
tags: vuejs,crypto-js
---
{% gist https://gist.github.com/chhumsina/71365dce96e74ac4c53f97facdf70593 %}
How to Build a Site Quickly If You Are Not a Web Developer: AWS + Google Sheets + Python + Bootstrap ⚡⚡
Tags: python, aws, todayilearned
Published: 2020-04-10 09:45:25

A week ago, I was looking for courses that were free or discounted due to the COVID-19. I thought that maybe others were doing the same, so I decided to compile resources and publish them online.

I started compiling the courses using Google Sheets and was planning on sharing the sheet after I had enough resources. However, something was bothering me. Opening sheets on a mobile suck and most people use their phones for browsing the internet. I thought I could do better.

The issue is that I'm a Data Scientist, not a Web Developer. I hardly have any experience building and deploying web pages on my own. So I decided to build a simple static site that met the following requirements:

1. Look good on mobiles (or at least better than a Google Sheet)
2. Should allow me to easily add or remove resources
3. Use Python as much as possible (and as little as possible of HTML/CSS/JS)
4. Should take me only a few hours to develop and launch
5. Maintenance should be *very very* close to zero :stuck_out_tongue:

So here's what I did to solve these issues:

1. Used Bootstrap to make it responsive and look good without a lot of effort from my side
2. Used Google Sheets as a basic Content Management System. Got content into the site programmatically using the API
3. Used Jinja2 as a templating engine
4. Hosted the site on AWS S3 + Cloudfront (for SSL certificate). Bought the domain using Route 53.
5. So far, I've only invested ~15€ on the site. I don't foresee that I will need to spend more than a few cents for its maintenance, given what AWS offers in its Free Tier.

Finally, after I had the first version, I published it on reddit and LinkedIn. It got some traction and was shared in different sites. During the first two days, it got over 3k visitors. The number of visitors has been steadily decreasing since then, totaling around 12.5k right now.

Building the site was an entertaining learning exercise for me and, based on how people reacted, it was useful for others. I was not really expecting to have more than a few visitors, so it was a positive surprise seeing how many people were interested.

I wanted to share the process and code in case others may find them useful.

Finally, here's the Github repository: [https://github.com/dylanjcastillo/stayhomeandlearn.org](https://github.com/dylanjcastillo/stayhomeandlearn.org)

Also, here's the site: [https://stayhomeandlearn.org](https://stayhomeandlearn.org/)
Two Helpful Tools to Automate Your Windows Setup
Tags: windows, powershell, automation, setup
Published: 2020-04-10 09:27:31

I like to have the same configuration & software on all my systems. I also do not want to spend hours on my setup, while resetting my machine or setting up a new one. With Linux, this has always been pretty easy: Just put your dotfiles on a git repo and clone them when you set up a new machine.

Microsoft is currently working on enhancing the development experience on Windows. They are actively working on a new [terminal emulator](https://github.com/microsoft/terminal), a [window manager](https://github.com/microsoft/PowerToys/tree/master/src/modules/fancyzones), a way to use [Linux on your Windows machine](https://ubuntu.com/wsl) and more.

Two years ago they started working on a [collection of scripts](https://github.com/microsoft/windows-dev-box-setup-scripts), to get a new development machine ready with just one click. They have scripts to set up a WSL/Hyper-V, Docker/Kubernetes, NodeJS, Machine Learning, C++ desktop app or Web stack development environment. While those are great, you can also use them as inspiration to create your own collection of scripts.

We need two tools for our automated setup:
- [Chocolatey](https://chocolatey.org): A package manager for Windows (like `apt-get` for Linux), which can install most software with just a command
- [Boxstarter](https://boxstarter.org): A tool to automate the configuration of Windows settings and installation of Chocolatey packages.

I recommend you to copy one of the scripts from [Microsoft's collection](https://github.com/microsoft/windows-dev-box-setup-scripts) and adjust it to your needs.

You can install packages using Chocolatey like so:
1. Fing your package on the [online database](https://chocolatey.org/packages)
2. Add the following to your Boxstarter script or open a Powershell terminal with admin privileges and execute: `choco install <package name> -y`

You can change your Windows settings by executing Boxstarter scripts like so:
1. Have a look at the [Boxstarter repository](https://github.com/chocolatey/boxstarter) and find a script you want to use.
2. Add the script to your Boxstarter setup script or open a Powershell terminal with admin privileges and execute it. For example: `Set-TaskbarOptions -AlwaysShowIconsOn`

You then can use your script to build a one-click-package by appending your public script/repo/gist to a URL, like so: `http://boxstarter.org/package/url?https://raw.githubusercontent.com/GITHUB_DOMAIN/GITHUB_REPO/YOUR_BRANCH/RECIPE_NAME.ps1`
geth syncmode
Tags: geth, ethereum, synmode
Published: 2020-04-10 09:09:42

---
title: geth syncmode
published: true
description: 
tags: geth, ethereum, synmode
---

### Full
`$ geth --syncmode full`
```
- BlockHaeder
- BlockBody
  - Transactions[]
  - Uncles[]
- Receipt
- State
```
700GB

### Fast (default)
`$ geth --syncmode fast`
```
- BlockHaeder
- BlockBody
  - Transactions[]
  - Uncles[]
- Receipt
```
150GB

### Light
`$ geth --syncmode light`
```
- BlockHeader
```
Xamarin Forms Component Based UI with ReactorUI
Tags: xamarinforms, csharp, dotnet
Published: 2020-04-10 09:08:11

:wave: ReactorUI is **component based UI** library for Xamarin Forms that let you create a mobile application using an approach similar to React.js or Flutter.
It's written on top of XF so you can access the same controls/features of a standard XF application, including 3rd party libraries.

:rocket: ReactorUI also features a pretty fast **Hot Reload** module that let you edit components while debugging.

![XF ReactorUI Hot reload in action](https://github.com/adospace/reactorui-xamarin/blob/master/images/ReactorUI_HRDemo.gif?raw=true)

I've used ReactorUI for building a complex application and I could say that it was awesome.

Please take a look at GitHub repository:
https://github.com/adospace/reactorui-xamarin

:raising_hand: Please reach me here or on GitHub if you are interested in help with it!

!! THANKS !!!
Documentation tips for developers
Tags: documentation, writing, tips, developers
Published: 2020-04-10 09:01:00

---
title: Documentation tips for developers
published: true
description: As a follow-up to my last video, I wanted to share some tips on writing good documentation, based on my own experience.
tags: documentation, writing, tips, developers
---

As a follow-up to my last video, I wanted to share some tips on writing good documentation, based on my own experience.

Summary of the tips:

✔️ Keep articles short
✔️ Cover one main concept per article
✔️ Use every name of the concept
✔️ If more than one person asks, write about it
✔️ Collaborate! Make it a team effort
✔️ Use plenty of examples
✔️ Use screenshots
✔️ Use simple diagrams
✔️ No read/write controls
✔️ Link to documentation from tasks, chat messages, etc.
Sourcing data from GraphCMS with GraphQL, and Gatsby
Tags: graphql, gatsby, javascript, react
Published: 2020-04-10 08:58:33

---
title: Sourcing data from GraphCMS with GraphQL, and Gatsby
published: true
description: Start creating pages and content programmatically with a GraphQL API.
tags: graphql, gatsby, javascript, react
---

In this video we get to grips with Gatsby, GraphQL and GraphCMS for creating pages programmatically!

{% youtube fqImaAnPNvA %}
DeepCode's Top Findings #13: Writing Immutable Objects in Python
Published: 2020-04-10 08:57:49

[DeepCode](https://deepcode.ai) offers an AI-based Static Program Analysis for Java, JavaScript and TypeScript, C/C++ and Python. As you might know, DeepCode uses thousands of open source repos to train our engine. We asked the engine team to provide some stats on the findings. On the top suggestions from our engine, we want to introduce and give some background in this series of blog articles.

*Language:* Python
*Defect:* X is an immutable object and one of its elements gets assigned
*Diagnose:* The code tries to write to an element within an instance of an immutable data type 

![Writing into Range](https://dev-to-uploads.s3.amazonaws.com/i/hmhbbykvqswk7oomu4c2.PNG)

I found this example in [monkeylyf / interviewjam](https://github.com/monkeylyf/interviewjam) and as usual, you can open the repo in [DeepCode](https://deepcode.ai) and follow along. Below is the snippet of the dashboard in DeepCode:

```Python
def findCelebrityWithExtraSpace(self, n):
    """
    :type n: int
    :rtype: int
    """
    stack = range(n)
...
            stack[-2] = a
...
```
DeepCode gives us the feedback "Trying to store a value in element of immutable type range (from call to range) will lead to a crash." But does `range()` not bring a list back? Well, that used to be...

Let us replay what happens in the Python interpreter:

```Python
Python 3.8.1 (tags/v3.8.1:1b293b6, Dec 18 2019, 22:39:24) [MSC v.1916 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> stack = range(10)
>>> stack
range(0, 10)
>>> a = stack[-1]
>>> stack[-2] = a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'range' object does not support item assignment
>>>
```

What we are calling here is the `range()` function. In Python3 it is a renamed version of Python2's `xrange()` function. This means it does not actually produce a list with a sequence of values. Rather, it uses yielding to produce the specific value when it is needed instead of storing vast amounts of data. That is the reason why Python says the `range` _object_ does not support item assignment. And by the way, it also does not support the `pop()` function which is used in the code example.

In the above code example, the application would crash when trying to write into the `range` object. Yet, as ranges are used often as a sequencer for loops, ranges can get quite large. Thus it makes sense to use such a range object instead of a list. Yet, if you need the list as a datastore - such as in our example here - there is an easy way to get `lists` with value sequences:

```python
stack = list(range(n))
```
For the static code analysis, the task here was to understand the underlying type returned by the `range()` function and infer the abilities the type has (like supporting index operators).

Test it yourself and run analysis over your code. It is very fast and free to check out at [deepcode.ai](https://deepcode.ai).
Use Facades to Get Static Interface in Laravel
Tags: laravel, facades, helper, function
Published: 2020-04-10 08:56:53

Hello Artisan 

In this tutorial i am going to show you how we can create custom helper function in laravel using laravel facades. If you don't know how to use facades keyword in laravel get a static interface in your custom class, then you are a right place.

In this tutorial i will show you step by step that how we can use facades to get static proxies to a class. Simply we will create a folder in our app directory and then we will create our custom class. Using facades we will access our custom class from any where in our application.

https://www.codechief.org/article/use-facades-to-get-static-interface-in-laravel
Roast my code
Tags: node, react, javascript
Published: 2020-04-10 08:45:32

---
title: Roast my code
published: true
description: Check this code, I need feedback
tags: nodeJS, react, js
cover_image: https://cdn.shopify.com/s/files/1/0625/4877/files/FullSizeRender_d0fa4657-e8d9-4bd0-b67a-f09eed9ff682_grande.jpg?15626287972368696775
---


Hi, after maybe 3 months, finally I finished my self-project.

What I tried to do with this project?
- Learn and build an entire APP with NodeJs and React

Why?
- Im a junior web developer, and I think it's time to create, to break, to get sick with this type of projects, learning by myself

What are you doing here?
- Well, I tried to use a new Stack, learning new auth systems, devs methods... If anybody is bored or want to check this code is in my GitHub.
Please I want your feedback, what I did wrong, what part is a bad practice, what part of my code is insecure, what part is a spaghetti, React components are a complete spaghetti?...

What can I do get better?
- Well I hope is someone want to tell me, I will read all the comments.
Thanks

Here's the project: https://github.com/KevinHCH/forum/
milliondollarpaint - A real-time multi-user drawing web app
Tags: twiliohackathon, javascript, showdev
Published: 2020-04-10 08:40:37

## What I built

Ever heard of the [milliondollarhomepage](http://www.milliondollarhomepage.com/)? It's a website that consisted of a million pixels arranged in a 1000 × 1000 pixel grid; the image-based links on it were sold for $1 per pixel in 10 × 10 blocks. More info [here](https://en.wikipedia.org/wiki/The_Million_Dollar_Homepage).

I created something similar, and instead of links, users will be able to draw in each pixel and let others see it in real-time.

Yes, I've seen a lot of posts using Twilio's sms, video and other communication APIs that will be helpful to the community in this crisis and I think that's enough already. I'm more of a "battle the loneliness" person and want other people to connect and just have fun.


## Demo Link

https://milliondollarpaint.herokuapp.com

## Link to Code

https://github.com/sorxrob/milliondollarpaint

## How I built it

I used HTML Canvas for creating and drawing graphics and JavaScript and Vue for manipulation of the Canvas. Each pixel has an x and y coordinate and will be saved in a shared state using Twilio Sync. [Twilio Sync](https://www.twilio.com/docs/sync) offers us two-way real-time communication between different devices.

Detailed stack:
- Node
- JavaScript
- Twilio
- Vue
- Vuetify
- HTML
- CSS

## Additional Resources/Info

When testing, open up 2 browsers. Stay at the homepage for the first browser, and try to draw anything on the 2nd browser and click save to see the real-time magic happen using Twilo Sync!

Also, I am using heroku free tier so it might take some time on your first load.
If you could only get one tech newsletter, what would it be?
Tags: discuss, productivity, newsletters
Published: 2020-04-10 08:35:09

---
title: If you could only get one tech newsletter, what would it be?
published: true
description: 
tags: discuss,productivity,newsletters
---

**What's one newsletter or digest that you could not live without as a developer?**

I realized I get close to ten weekly newsletters about tech-related things.

I certainly do not read them all every week. I try to glance through a few (especially when the subject line is interesting) when I'm waiting for builds and what have you, but yeah. I'm thinking of unsubscribing from a handful to reduce inbox clutter, which got me to thinking: Which one gives me the most consistent value?

As of this moment, I'd personally say [Web Dev Monthly](https://zerotomastery.io/blog/?tag=WDM) by Andrei Neagoie. He does an end-of-the-month summary of the most important web development happenings for that month. I know "most important" depends greatly from person to person, but in my opinion his round-ups are pretty spot on.
Web Share API test
Tags: webshare, api, ios, safari
Published: 2020-04-19 15:32:58

---
title: Web Share API test
published: true
date: 2020-04-10 08:31:51 UTC
tags: webshare,api,ios,safari
canonical_url: https://adactio.com/journal/16721
---

Remember a while back I wrote about some odd behaviour with [the Web Share API in Safari on iOS](https://adactio.com/journal/15972)?

> When the `share()` method is triggered, iOS provides multiple ways of sharing: Messages, Airdrop, email, and so on. But the simplest option is the one labelled “copy”, which copies to the clipboard.
> 
> Here’s the thing: if you’ve provided a text parameter to the `share()` method then _that’s_ what’s going to get copied to the clipboard—_not_ the URL.
> 
> That’s a shame. Personally, I think the `url` field should take precedence.

[Tess filed a bug](https://bugs.webkit.org/show_bug.cgi?id=203221) soon after, which was very gratifying to see.

Now [Phil has put together a test case](https://www.gyford.com/misc/web-share-api.html):

> 1. Share URL, title, and text
> 2. Share URL and title
> 3. Share URL and text

Very handy! The results (using the “copy” to clipboard action) are somewhat like rock, paper, scissors:

- URL beats title,
- text beats URL,
- nothing beats text.

So it’s more like rock, paper, high explosives.