teleren/devto huggingface dataset:
The advent of tooling for Big Rails
Tags: rails, tooling, components, packwerk
Published: 2022-06-20 15:02:55

---
title: The advent of tooling for Big Rails
published: true
description: Innovations in tooling for big Rails project structuring
tags: Rails, tooling, components, packwerk
cover_image: https://i.postimg.cc/ydZdY9F5/bigrails.jpg
---

Today my colleagues shared a [presentation](https://speakerdeck.com/alexevanczuk/laying-the-cultural-and-technical-foundation-for-big-rails) by [Gusto](https://engineering.gusto.com/)'s Alex Evanczuk.

It presents a clear ideology and [tooling](https://github.com/rubyatscale) for carving up a monolithic Rails app into something more manageable by multiple independent teams **while leaving everything in the same repo**.

For me, the most important aspect of a growing Rails app is handling of complexity and interdependencies and turns out Shopify's [packwerk](https://github.com/Shopify/packwerk) is just what the doctor ordered - it leverages zeitwerk loader to improve on Rails' vanilla file structure, allowing to group files by business concept or sub-domain and control visibility and ownership.

Ever wanted to create a tight, team-owned API that can (indeed, must) be used by other teams, without giving them access to internals? `packwerk` lets you do that.
Ever wanted to maintain SOLID and clean component architecture principles in a large Rails codebase and push abstractions/ core business logic to the core and everything else to the periphery? `packwerk` lets you do that.

Check out Shopify's own [writeup](https://shopify.engineering/enforcing-modularity-rails-apps-packwerk).

Come fall, I'll be carving out my team's components from the monolith.

Photo by <a href="https://unsplash.com/@jacksloop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Jack Sloop</a> on <a href="https://unsplash.com/s/photos/big-rails?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText">Unsplash</a>
pbcopy and pbpaste: Mac command-line copy and paste tools
Tags: mac, command
Published: 2022-06-20 14:55:16

---
title: pbcopy and pbpaste: Mac command-line copy and paste tools
published: true
description:
tags: mac, command
---
`phcopy` and `pbpaste` are super useful command-line tools for Copy and Paste (ctrl+c / ctrl+v).

```
# copy content from a text file
$ cat my-file.txt | pbcopy
# paste (output) from clipboard
$ pbpaste
```
Applying complex filters to match your data
Tags: productivity, opensource, github, news
Published: 2022-06-20 14:41:17

[kern.ai](http://kern.ai) makes complex things easier. I’m sure you are wondering how is this possible ? With kern it’s possible to apply complex filters that fit with your data. Another interesting thing you can do is utilising the metadata generated by your heuristics (such as labeling functions) to easily filter your data. Our software makes it easier and faster to analyse interesting sets of data matching your needs. Once the filters have been finalized, it can be saved later for analyzing it in the project analytics page.The left hand side consists of extensive filtering options that allow the user to slice the data according to their needs. You can also order your results, for example ordering by weak supervision confidence to refine the records where the label model is still struggling. The right hand side then displays the records that match the applied filters you can see above. Attribute filters are highlighted for an easy UI experience.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/dgto1eb7t7uavawn3a4m.png)

Subscribe to our newsletter 👉🏼 [https://www.kern.ai/pages/open-source](https://www.kern.ai/pages/open-source) and stay up to date with the release so you don’t miss out on the chance to win a GeForce RTX 3090 Ti for our launch 😉
11ty second 11ty: The Render Plugin Part 1
Tags: 11ty, javascript, jamstack
Published: 2022-06-20 19:21:23

---
title: 11ty second 11ty: The Render Plugin Part 1
published: true
date: 2022-06-20 14:30:00 UTC
tags: 11ty, javascript, jamstack
canonical_url: https://bryanlrobinson.com/blog/11ty-second-11ty-the-render-plugin-part-1/
---

{% embed https://youtube.com/embed/AXyedHIE7Fc %}

The Render plugin is comprised of two shortcodes for use in your Nunjucks, Liquid or JS templates. It’s a plugin that is bundled with the main 11ty NPM package and ready to use as soon as you nom install 11ty.

To get started with the plugin, you need to install it in your `.eleventy.js` config file by requiring the plugin and then initializing it

```javascript
const { EleventyRenderPlugin } = require("@11ty/eleventy");

module.exports = function(eleventyConfig) { 
  eleventyConfig.addPlugin(EleventyRenderPlugin);
}
```

The two shortcodes it adds to your project are `renderTemplate` and `renderFile`.

In this part, we’ll tackle `renderTemplate`.

`renderTemplate` allows you to put a string between two matching shortcodes and render that string in a templating language different from that of the current template

## Using the `renderTemplate` tag

```html
<!-- ...head, etc. -->
<body> 
  <p>The date is: {{ today | date: "%B %d, %y" }}</p>
</body>
```

Here we have a Nunjucks index page. In this page, we have a date time. It’s not great to read for a human. I want to reformat that in the template with a filter, but uh-oh, Nunjucks doesn’t have a date filter! Now that my project has the renderTemplate paired shortcode, I can get to work.

```html
{% renderTemplate "liquid", settings %} 
  <p>The date is: {{ today | date: "%B %d, %y" }}</p>
{% endrenderTemplate %}
```

The renderTemplate tag accepts two arguments: the templating language we wish to use (any [template string](https://www.11ty.dev/docs/config/#template-formats) that eleventyConfig accepts will work such as `html,liquid,ejs,md,hbs,mustache,haml,pug,njk,11ty.js`) and an optional set of data.

In this case, I want to render the string with Liquid and I want to get a variable off the settings global JavaScript data file that is generating the current date.

Anything between the `renderTemplate` and the `endRenderTemplate` will be rendered in Liquid instead of Nunjucks.

This allows me to use the powerful date filter in liquid to format the date time string create by a JS data file (named settings.js).

Or for a simpler use case, sometimes writing Markdown is more ergonomic than writing HTML, so why not embed a little Markdown in your HTML

```html
{% renderTemplate "liquid,md" %}
# I am a title

* I am a list
* I am a list

1. I am an ordered list
1. i'm actually second in an ordered list test
{% endrenderTemplate %}
```

## Template engines all the way down!

This plugin opens the door to a lot of new possibilities. Any templating language can be embedded in any page or template! 11ty: It's templates all the way down!

Just want the code? Check the [11ty Second 11ty repo](https://github.com/brob/11ty-second-11ty/tree/main/render) for this and others!
Into Data Structures and Algorithms
Published: 2022-06-20 14:18:30

##**DATA STRUCTURES**
 This is the gathering and storing of data in a systematic way for us to be able to perform some operations on the stored data.

**_Linear Data Structures_**
 Elements are sorted in a particular order which makes them easy to implement but in the case of a complex program linear data structures might not be the best.

- Array
- Stack
- Queue
- Linked Line

**None-Linear Data Structures**
 elements are arranged in a hierarchical manner.

- Graph Data Structures
- Tress Data Structures

## ALGORITHMS
 An algorithm is a defined set of steps for solving a well defined problem.
API ATTACKS
Tags: blst, webdev, beginners, github
Published: 2022-06-20 14:02:18

As API attacks become more common, it's important to understand what they are and how to protect your APIs. API attacks are a type of cyberattack that targets a programmatic interface, typically an application programming interface (API), to steal data, fraud, or ATO - Account Take Over. API attacks can be carried out in a number of ways, but the most common is a malicious actor spoofing a legitimate user's credentials to gain access to the API.

API attacks can have serious consequences, including data breaches, fraud, and ATO - Account Take Over.

API attacks are on the rise and becoming more sophisticated. Here’s what you need to know to protect your APIs from attacks.

![API](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/i4ir7zoke76rhredawni.png)

**What are API attacks?**

API attacks can be carried out in a number of ways, but the most common is a malicious actor spoofing a legitimate user’s credentials to gain access to the API. Once these malicious actors have access, they can start extracting data or launching attacks.

**Why are API attacks becoming more common?**

There are a few reasons why API attacks are on the rise.
These include:


- More and more businesses are exposing APIs to enable third-party developers to build integrations with their applications. This gives malicious actors more opportunities to exploit APIs.
- APIs are often less protected than other parts of an application. They may not have in place the same level of security controls, such as authentication and authorization.
- API attacks can be highly effective. They can give attackers a way to bypass security controls and gain access to sensitive data.

**How can you protect your APIs from attacks?**

There are a number of steps you can take to protect your APIs from attack:

**Implement authentication and authorization:** Ensure that only authorized users are able to access your APIs. This can be done through authentication, such as OAuth, and authorization, such as role-based access control.

**Use encryption:** Encrypt data in transit to and from your APIs to protect them from being intercepted by attackers.

**Monitor activity on your APIs:** Look for any suspicious activity that could indicate an attack. This can be done using a web application firewall (WAF) tool. Keep your APIs up to date with the latest security patches to prevent attackers from exploiting known vulnerabilities.

**Check the validation in your APIs to see all your connections:** Nowadays, it's very difficult to know all the business logic and the endpoints that your APIs have.

In addition, you can check out our **BLST tool**, which **finds broken logic in your API and maps it**. Our online mapper shows you how your API works and helps you understand it.
You can use the detailed information to find all the code bits or parameters in your API that aren't working properly: https://www.blstsecurity.com 

By taking all of these steps, you can help protect your APIs from attack.

Thanks for reading my post. If you enjoy my content, please consider following me :)
The Luos Blog is the perfect place to get information and keep an eye on many topics
Tags: edge, luos, embedded, blog
Published: 2022-06-20 14:16:09

The Luos Blog is the perfect place to get information and keep an eye on many topics: **embedded** and **edge** systems, **microservices** in **hardware** devices, **robotics**, Luos 🙂 , about PID control in motors, etc...

⏩ [https://www.luos.io/blog](https://www.luos.io/blog)

But not only that! We will also talk about motors used for robotics and electronics broadly. Many projects are waiting for you on the Luos blog with texts, webinars, and videos, so bookmark the blog and join our **Discord community** for even more exchanges on your projects!
Profiling Flask Apps
Tags: python, flask, profiler, webdev
Published: 2022-06-20 14:08:31

When you're working on Flask apps, at some point one of your routes could get slow in terms of performance (returning response to the client).

The best way to approach such problems (slow programs) is to use a profiler to analyse which parts of your code is slowing down the application.

In Flask we can use the Werkzeug Profiler Middleware to implement profiling in our Flask apps. It is super simple!

```
from flask import Flask
from werkzeug.middleware.profiler import ProfilerMiddleware

app = Flask(...)
app.wsgi_app = ProfilerMiddleware(app.wsgi_app)
```

That's it! Now when you make a request to one of your endpoints, in your console log, you'll notice stats getting dumped.

```
----------------------------------------
PATH: '/search'
         7508936 function calls (7492431 primitive calls) in 3.824 seconds

   Ordered by: internal time, call count

   ncalls  tottime  percall  cumtime  percall filename:lineno(function)
        1    0.701    0.701    2.152    2.152 ...
   101132    0.485    0.000    0.485    0.000 ...
   166457    0.351    0.000    1.258    0.000 ...
  1440656    0.226    0.000    0.347    0.000 ...
5048/4702    0.165    0.000    0.327    0.000 ...
       ...

----------------------------------------
```

- If you'd like to learn more about configuring the profiler, head over to [this article](https://codingshower.com/profiling-python-flask-web-apps-with-werkzeug-middleware-application-profiler/).
- If you'd like to learn more about using a statistical profiler, head over to [this article](https://codingshower.com/profiling-python-flask-web-apps-with-pyinstrument/).
Connecting PostgresDB hosted on Heroku to Sequelize
Published: 2022-06-20 13:53:13

I stumbled upon this error last time. I followed all the the classical information on how to connect sequelize to your PostgresDB hosted on Heroku but I kept getting this error

`Unable to connect to the database: ConnectionError [SequelizeConnectionError]: no pg_hba.conf entry for host`

The solution I found to fix this problem was
`const sequelize = new Sequelize(DB_URI, {
  dialectOptions: {
    ssl: {
      rejectUnauthorized: false,
    },
  },
});`
where `DB_URI=postgres://User:Password@HOST:PORT/Database`
Is Cypress Easy to Learn? GET and FIND Command Hacks💻 | Cypress Tutorial | Part II
Tags: javascript, beginners, tutorial, cypress
Published: 2022-06-20 13:52:41

This video showcases the “GET” and “FIND” commands in this Cypress Testing Tutorial Series. [Try LambdaTest now](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=jun20_sb&utm_term=sb&utm_content=tutorial_video)


Get Started with LambdaTest Cypress Automation - [https://bit.ly/2TU9YsQ](https://bit.ly/2TU9YsQ)

Know more on LambdaTest Cypress Testing - [https://bit.ly/3Cbd8JR](https://bit.ly/3Cbd8JR)


This video is a part of the Cypress Testing Tutorial series. It showcases the usage of "GET" and "FIND" commands supported by the Cypress test automation framework. 🪐

By the end of this video, you will learn 🎫 -:

🔸 How to write the first Cypress test?
🔸 Is Cypress easy to learn?
🔸 WebElements on the DOM (Document Object Model) using the GET command?
🔸 Where to use the FIND command?
🔸 When and how to use GET and FIND commands?
🔸 How to navigate around the DOM using Cypress?
How to run a ruby web server on your android device (without root).
Tags: android, ruby
Published: 2022-06-20 13:48:20

---
title: How to run a ruby web server on your android device (without root).
published: true
description: This is a quick step by step instructions on how to run a ruby based web server on your android.
tags: android, ruby
# cover_image: https://direct_url_to_image.jpg
# Use a ratio of 100:42 for best results.
---
Here is how you can quickly run a ruby based web server in your android device. There are many development activities you can do in your android device. This is an easy one. So, I will be quick without going into details. I expect you know basics of linux terminal.

## Step 1 : Termux
Termux is a linux terminal for your android. It also includes a package manager using which you can install many packages including ruby. The first step is to download and install [termux](https://termux.com/). Do not download from play store. The play store version is pretty outdated. Get it from FDroid or github

## Step 2 :  Packages
`pkg` is the package manager available in your Termux. We need to install ruby and openssl
open termux and type
```
pkg install ruby openssl
```
It will install ruby and all required packages like clang. 

## Step 3 : Editor
I prefer vi editor. If you are new to vi editor, Please make sure you know the basics and especially how to exit vim 😀
```
pkg install vim
```

## Step 4 : Gems
First we will install thin web server
```
gem install thin
```
Then we will install `sinatra` framework. Sinatra will help us to quickly create a hello world example website.
```
gem install sinatra
```

## Step 5 the server.rb
First create a directory for convenience. 
```
mkdir ruby-example
```
Then go there,
```
cd ruby-example
```
Now create server.rb with the following content
```
vi server.rb
```
```ruby
require 'sinatra'

get '/' do
  'hello '*300
end
```
Now exit vim using the esc key provided in the UI and then `:wq` - Save and exit. 

## Step 6 : Visit the website
in your chrome web browser go to http://localhost:4567
It. You will see 300 `hello`s in your browser. 

## Step 7 Stopping the server
Press the `CTRL` button in the UI and then `c` to exit

## Now what
This is not limited to ruby. Using termux you can do a lot more developmental activities in your android device. This is very powerful.
Introduction to Cypress Testing | Web Automation | Cypress Tutorial | Part I
Published: 2022-06-20 13:47:08

Learn how to get started with Cypress Testing and run cross-browser tests with Cypress on the LambdaTest cloud platform. In this tutorial, we deep dive into how cloud cypress testing can be realized with LambdaTest.

Start FREE testing. [Start FREE Testing](https://accounts.lambdatest.com/register?utm_source=devto&utm_medium=organic&utm_campaign=jun20_sb&utm_term=sb&utm_content=tutorial_video)!


Try Cypress Testing on LambdaTest now-: [https://bit.ly/2TU9YsQ](https://bit.ly/2TU9YsQ)


This video is a part of our Cypress testing tutorial series for beginners. Cypress is a JavaScript-based test automation framework that helps you write and automate JavaScript tests. In this video, Chris DeSilva (@desilvadev) talks in detail about Cypress and how to use Cypress's testing suite to deliver high-quality web applications to end-users. Additionally, he explains how to integrate cypress with a cloud-based Cypress grid on LambdaTest.

This video will help answer the following questions 🎫 -: 
🔹What is Cypress?
🔹How to install cypress?
🔹How to download and install Cypress?
🔹What can Cypress be used for? 
🔹What is end-to-end testing?
Teachable Launch Accelerator Challenge
Tags: teachable, elearning, course
Published: 2022-06-20 13:42:06


Der Teachable Launch Accelerator (TLA) ist ein 13-wöchiges Programm für gemeinnützige Organisationen, Sozialunternehmen und Start-ups in der Frühphase. Unter der Leitung der Gründer von Reverse The Course - Sean McComb und Laila Gosselin - werden die Teilnehmer/innen dabei unterstützt, die Herausforderungen einer erfolgreichen Markteinführung zu meistern, ihr Softwareprodukt auf den Markt zu bringen und ihr Publikum zu vergrößern. In der letzten Woche des TLA-Programms präsentierten 10 Gründer/innen ihre Unternehmen vor einer Jury und erhielten jeweils 7.500 $ zur Finanzierung ihres Unternehmens. Die Gewinner wurden am 25. Juli 2018 bekannt gegeben.

Die Teachable Launch Accelerator Challenge ist eine Chance für Entwickler/innen, Unternehmer/innen und gemeinnützige Organisationen auf der ganzen Welt, gemeinsam die besten Bildungstools des Jahres 2018 zu hacken. Der kostenlose 12-Wochen-Kurs hilft den Teilnehmern, ein Minimum Viable Product (MVP) zu entwickeln, ihre Ideen auf den Markt zu bringen und mit innovativen Bildungsorganisationen zusammenzuarbeiten.

Start the Teachable Launch Accelerator Challenge ist ein offener, 12-wöchiger Online-Accelerator für Unternehmer/innen. Er wurde entwickelt, um Startups die Ressourcen, Mentoren und Unterstützung zu geben, die sie brauchen, um ein erfolgreiches Bildungs-Startup aufzubauen und zu starten.

Die Launch Accelerator Challenge, die von Teachable angeboten wird, ist ein 12-wöchiger Online-Kurs zum Selbststudium ($349) für Unternehmen und Pädagogen. Die Challenge beginnt mit einer Einführung in Design Thinking, gefolgt von drei Modulen (Envisioning, Developing und Testing) und schließt mit dem Capstone (Launching) ab.

Die Teachable Launch Accelerator Challenge ist die erste Veranstaltung des Accelerator-Programms von Teachable, das als Brücke zwischen Unternehmern, Start-ups und Pädagogen fungiert. Es soll innovative Ansätze für Bildung und Lernen fördern und Unternehmern helfen, mit ihren Produkten Geld zu verdienen.
Cosmos Db - Increase the paging result size
Published: 2022-06-20 13:36:50

I wasn't aware that the paging size in the Cosmos Db *Data explorer* can be configured.
So it was able to increase the page size from 100 to 1000,

## Settings

The settings gear opens a configuration dialog:

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1655281607440/thY2vxu76.png?auto=compress,format&format=webp align="left")

The dialog with 
- Page options
- Enable cross-partition query
- Max degree of parallelism

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1655281662876/YQ4FMxV3-.png?auto=compress,format&format=webp align="left")

## Result:

Before:

![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1655281736892/2MA1GH1pq.png?auto=compress,format&format=webp align="left")

After:


![image.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1655281707605/LmRKlOYxS.png?auto=compress,format&format=webp align="left")

## Data

The Cosmos Db was filled with [Sample data](https://github.com/Azure-Samples/azure-cosmos-db-sample-data/tree/main/SampleData) by using [Data migration tool](https://docs.microsoft.com/en-us/azure/cosmos-db/import-data).
mint.fun | Made with Next JS
Published: 2022-06-20 13:31:51

![mint.fun | Made with Javascript | Next JS](https://res.cloudinary.com/madewithjavascript/image/upload/v1655466014/large_mint_fun_made_with_next_js_b51e724536.png "mint.fun | Made with Javascript | Next JS")


### Discover and mint new NFT projects in one interface.

> Discover and mint new NFT projects in one interface.
> 
> mint.fun spots freshly minted tokens and present all known minting options to you..
> 
> 
> 
> 

## Check out more such amazing projects on our website

[Made with Javascript](https://madewithjavascript.club)

## Want us to feature your project

[Submit your Project to Made with Javascript](https://madewithjavascript.club/submit-project)


You can also write to us for any of your queries at:

[Email Made with Javascript](mailto:madewithjavascript@gmail.com)

## Project already shared on our social media handles.

| SocialMedia | SharedLink |
| ----------- | ---------- |
| Twitter | [mint.fun on Twitter](https://twitter.com/withjavascript/status/1538876106748612608?s=20&t=F7URlCxzzr2V9-yg0H5gqA)
 |
| Medium | [mint.fun on Medium](https://medium.com/@madewithjavascript/mint-fun-made-with-next-js-c8fc6f92ffdd)
 |
| Facebook | [mint.fun on Facebook](https://www.facebook.com/madewithjavascript/posts/pfbid02crDX4Bqnbk14Cyt4gpkHXJraXnArHcmJgbi6Qg6y5gFNYnukETGJhkVHdMmJjXnHl)
 |
| Tumblr | [mint.fun on Tumblr](https://www.tumblr.com/blog/view/madewithjavascript/687584702197022720?source=share)
 |
| LinkedIn | [mint.fun on LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:6944641905800462336)
 |
| Pinterest | [mint.fun on Pinterest](https://pin.it/3SjfMHj)
 |


Filled Under:
 - [Made with Javascript](https://madewithjavascript.club)
 - [Made with Next JS](https://madewithjavascript.club/categories/next-js)

Make sure to give this post ❤ 50 ❤ hearts, click the 🦄 unicorns 🦄 and follow 👉 @madewithjavascript 👈 for more such awesome showcases. Show you love for the people who have worked so hard!