teleren/devto huggingface dataset:
[RSpec] Controller/Request Spec Basic
Tags: rails
Published: 2019-10-28 04:52:38

---
title:  [RSpec] Controller/Request Spec Basic
tags: rails
published: true
---

## prepare
### set params to Post method
```ruby
let(:attributes) {
  author: 'n350071',
  publisher: 'my publish'
}
subject { post :create, book: attributes }
```

### set params to Get method
```ruby
let(:params) {
  author: 'n350071'
}
subject { get :index, params }
```

### set session
```ruby
before { session[:book_id] = book.id }
```

## Assertion
### send_file: downnload
```ruby
expect(response.headers['Content-Type']).to eq 'application/zip'
expect(response.headers['Content-Type']).to eq 'application/pdf'
expect(response.headers['Content-Type']).to eq 'application/doc'
```

### status & render & redirect_to
```ruby
expect(response.status).to eq 200
expect(response).to render_template :new

expect(response.status).to eq 302
expect(response).to redirect_to(new_book_path)
```

### 404 test

The 404.html is stored in 'public/404.html'.

```ruby
describe '#show' do
  context 'the resource is not found' do
    it 'should render 404' do
      get :file_download
      expect(response.status).to eq 404
      expect(response).to render_template(file: Rails.root.join('public','404.html'))
    end
  end
end
```

### JSON response
```ruby
it 'should respond JSON and returns message Hello' do
  json_data = JSON.parse(response.body)
  expect(json_data['message']).to eq 'Hello'
end
```


---

## 🔗 Parent Note
{% link n350071/my-rspec-note-17ec %}
What is Ethereum Gas
Tags: ethereum, blockchain, gas, solidity
Published: 2019-10-28 04:39:26

---
title: What is Ethereum Gas
published: true
description: 
tags: ethereum, blockchain, gas, solidity
canonical_url:  https://www.youtube.com/watch?v=ROBSk8DmWiE&list=PLbbtODcOYIoGCbFhgkySGunZ3mLXuQKTV
---


When you develop decentralized applications on Ethereum, quickly you will stumble upon the concept of Gas. 

This is very confusing to a lot of developers, but it's more simple that it seems.

In this video, I will give you a quick introduction to Gas, with simple questions & answers:

* What is Gas?
* Who pays Gas?
* Who receives Gas?
* When Gas is paid?
* How to pay Gas?

{% youtube ROBSk8DmWiE %}
You can add constructor in new version of fragment
Tags: android, fragment
Published: 2019-10-28 03:54:55

---
title: You can add constructor in new version of fragment
published: true
description: Last time developer still cannot add constructor in current fragment, in new version of fragment, constructor can added in our Fragment.
tags: Android, Fragment
---

##Fragment Factory help you create Constructor

Developer right now cannot add constructore in fragment, this advise come from officially google, when we still create constructore our IDE lint will show warning that suggest us to remove it. Constructor contain argument that will be execute in our fragment and we can create some dependecies injection, But we cant do that. Until now, We still face that we cannot add argument constructor when we initialise fragment. Until we meet the Fragment Factory, Fragment Factory will give you manage/control to build fragment and enable constructor.

Take a look this code, we just need to subclass Fragment Factory and we need customize the implementation and no need use Fragment. After that we must tell the Fragment manager to use this class to initialize the fragment.

```kotlin

class MyFragmentFactory (
    private val requestService: RequestService
) : FragmentFactory() {

    override fun instantiate(classLoader: ClassLoader, className: String): Fragment { ... }

}

// Your Activity
class MainActivity : AppCompatActivity() {

    @Inject
    lateinit var fragmentFactory: MyFragmentFactory

    override fun onCreate(savedInstanceState: Bundle?) {
        supportFragmentManager.fragmentFactory = fragmentFactory
        super.onCreate(savedInstanceState)
        ...
    }
}

```

Thanks to android community that can add this, basically this feature come and introduce in AndroidDevSummit last week ago. This release has some new overloads to enable you pass generic class into Fragment Factory to manage creating instace of fragment. 

```kotlin
supportFragmentManager.beginTransaction()
                .replace(R.id.fragment_container, SecondFragment::class.java, args = null)
                .commitAllowingStateLost()
```

If you want try it before stable you can add this into your build.gradle in level app.

```kotlin
def fragment_version = "1.2.0-rc01"
  implementation "androidx.fragment:fragment-testing:$fragment_version"
  implementation "androidx.fragment:fragment-ktx:$fragment_version"
```
Custom Python REPL
Tags: python
Published: 2023-01-06 01:51:49

---
title: Custom Python REPL
published: true
date: 2019-10-28 03:43:12 UTC
tags: Python
canonical_url: https://brandonrozek.com/blog/custom-python-repl/
---

Are you tired of importing the same libraries and setting up the same variables? Why not just create your own custom REPL? Now of course, we’re not going to do it from scratch, but instead utilize what Python already gives us.

Key Ingridient:

```
python -i prompt.py

```

This tells Python to run prompt.py and then take you into an interactive prompt.

Now let’s populate `prompt.py`

```
#!/bin/env python
import favorite_libraries

print("Welcome to your own custom REPL!")
print("Type help('function_name') to get a more detailed description on some of your own custom functions!")

def help(function_name):
    if function_name is "help":
        print("Your very own help tool!")
    else:
        print("Sorry we don't have a help written for that yet :(")

```
Introduction
Tags: laravel, php
Published: 2019-10-28 03:23:51

Hi there
My Name is Frederick Peñalo , a backend developer from Dominican Republic, a long time ago i was thinking a way for teach Laravel Framework and because is a the best frameworks currently. 

In this series, we will build a online store with Laravel 6, don't require avanced knowledge on the framework, but you will need it on PHP at least the basics (Class, Method, Traits, Objects).

So, i'm pleased for your time and appreciate that you read this post

PD: I'm learning English, i would be very grateful if you give your feedback

Thank you ♥
Code review checklist
Tags: mentoring, codequality, bestpractices
Published: 2019-10-28 03:16:13

Recently, I've been doing code reviews for a group of junior devs. I'm pleased to have the opportunity, but I find we're spending more time on fundamentals than the actual stories.

To address this, I've put together a checklist of things to check before submitting your code to be reviewed. It's not meant to be exhaustive, just a short list intended to help us spend less time reviewing the basics and more on the parts the basics are supporting.

Are there other items you'd include on this list?

* Is the code up to date with `master`?
* Does the code run? Do all the tests pass? (This also means no "expected failures.")
* Do all the classes and methods have comments?
* Have you removed all of your "debugging" code (e.g. System.out, console.log, or other platform equivalent).
* There should not be any outstanding changes from previous reviews.
* There should not be changes which aren’t part of the specific ticket you're working on.
* There should be no blocks of commented out code.
Front-end Developer CV
Tags: codepen
Published: 2019-10-28 03:02:12

---
title: Front-end Developer CV
published: true
tags: codepen
---

<p>I love Programming ♥ :)</p>

<p>ty for view, please click like :)</p>

<p>//<a href="mailto:israplenitud@gmail.com" target="_blank">israplenitud@gmail.com</a> 
//<a href="https://isra.netlify.com/" target="_blank">https://isra.netlify.com/</a></p>

{% codepen https://codepen.io/isradlangel/pen/boBEPB %}
Tech Lead Squad 💪 - What's on Tap This Week (10/28)
Tags: career, leadership, techlead
Published: 2019-10-28 02:06:20

---
title: Tech Lead Squad 💪 - What's on Tap This Week (10/28)
published: true
description: This week we're going to focus on making an impact as a tech lead
tags: career, leadership, tech lead
---

Hey tech leads,

Hope you’re having a fun weekend and that, if you’re in one of the twenty or so countries celebrating Halloween, you got to do some of the preparty events. Is it me, or does Halloween seem like a bigger and bigger deal each year? 

More importantly, if you have kids, I strongly urge you to brace for the inevitable sugar crash coming as you try to get your kids to school on Friday morning.

## We're going to talk about impact as a tech lead this week!

Getting back to business. For the past two weeks, I’ve been pretty focused on your self identity as a leader. I’ve been challenging you to both focus on the habits that support that identity actually developing that identity from the outside in instead of the inside out.

This week I’m going to pivot from YOU to your IMPACT. I like thinking about impact first because I think it helps to clarify a lot about what you should be doing as a tech lead. 

Focusing on impact forces you to lead with your intentions, whether those intentions are about having a strong technical impact on the product or those intentions are about improving your team’s capabilities. 

> “If you aren’t intentional about your impact, you can’t complain about where your life takes you. If you want to drive the bus of your life, you must be own your impact.” [Forbes](https://www.forbes.com/sites/forbescoachescouncil/2017/10/16/what-is-your-impact/#30704efd6f35)

So on **Monday**, we’ll start with an overview of what impact means, why it matters, and why, really, you’re having an impact whether you mean to or not.

Then on **Wednesday** and **Friday**, we’ll talk about scaling up that impact on both your team and your technology, respectively.

## Get on the list!

The 👆👆👆 articles will hit inboxes (and podcasts) on Monday, Wednesday, and Friday. I may post some of the content here, but may not. 

**[Get on the list](https://michaelrice.substack.com)** to have the posts delivered straight to your inbox.

I promise to bring **certainty**, **clarity**, and **confidence** to you in your tech lead role.
Install Istio with kubectl
Tags: eks, istio
Published: 2019-10-28 01:37:13

---
title: Install Istio with kubectl
published: true
description: 
tags: eks, istio
---

To install Istio on EKS with `kubectl`, we will need to use helm to generate the manifest and use `kubectl`to apply.

### Install Istio Init
```yaml
curl -L https://git.io/getLatestIstio | ISTIO_VERSION=1.3.3 sh -
cd istio-1.3.3
helm template install/kubernetes/helm/istio-init --namespace istio-system | kubectl apply -f -
```


### Install Istio Demo
```yaml
kubectl apply -f install/kubernetes/istio-demo.yaml
```

Output

```yaml
$ kubectl get pods -n istio-system
NAME                                      READY   STATUS      RESTARTS   AGE
grafana-9bdbcc98d-gzntp                   1/1     Running     0          23m
istio-citadel-6759c5c4d4-7wlnw            1/1     Running     0          23m
istio-egressgateway-c7776cf56-zjnx8       1/1     Running     0          23m
istio-galley-8544f4ff94-9qj4m             1/1     Running     0          23m
istio-grafana-post-install-1.3.3-l989d    0/1     Completed   0          23m
istio-ingressgateway-8469cb69c5-kjvkc     1/1     Running     0          23m
istio-pilot-748dd866dc-rh25k              2/2     Running     0          23m
istio-policy-5c564f5bfb-8hvgc             2/2     Running     1          23m
istio-security-post-install-1.3.3-7pp5z   0/1     Completed   0          23m
istio-sidecar-injector-59c8999585-lqlj7   1/1     Running     0          23m
istio-telemetry-5fc579cb56-sjd9d          2/2     Running     1          23m
istio-tracing-6f585d8877-24974            0/1     Running     10         23m
kiali-5764f9c44d-c7ftg                    1/1     Running     0          23m
prometheus-85d75b5f6b-fn7f2               1/1     Running     0          23m

```

### Bookinfo application

```yaml
kubectl label ns istio-system  istio-injection=disabled
kubectl label ns istio-demo  istio-injection=enabled
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
```

```yaml
$ kubectl get pods
NAME                             READY   STATUS    RESTARTS   AGE
details-v1-c5b5f496d-p5lr7       1/2     Running   0          98m
helloworld-v1-7bb88866c4-hj8m2   2/2     Running   0          108m
helloworld-v2-6cd449dff4-mxjwn   1/2     Running   0          108m
productpage-v1-c7765c886-tbd2c   2/2     Running   0          98m
ratings-v1-f745cf57b-qpthv       2/2     Running   0          98m
reviews-v1-75b979578c-6hslt      2/2     Running   0          98m
reviews-v2-597bf96c8f-q92v7      2/2     Running   0          98m
reviews-v3-54c6c64795-9gc9q      2/2     Running   0          98m
```
Gulp This Project!
Tags: gulp, html, css
Published: 2019-10-28 01:25:20

<h1><center>My Portfolio Site - Pt 1</center></h1>
*********************************************************

I decided to launch a static site to quickly bring my online presence together. I'll always be able to launch a new version with more bells and whistles when I'm ready.  

I have tinkered with site generators like Gatsby but felt they were unnecessary for this first iteration of my site. I originally wanted as little code as possible for such a minimal project, but I quickly realized I'm not setting much structure for scale in the future. I think that what I lost in that initial preparation for scale doesn't necessarily justify the extremely small amount of code. 

I had skimmed over documentation for build systems like Gulp and Grunt and decided it would be good to start there. I chose Gulp and I really enjoyed it through this development process, especially with the addition of BrowserSync which allowed me to work from one machine and view on another. Finally I look like the quintessential depiction of a developer with two laptops and a desktop running on my desk, but I still don't fit the night owl stereotype.

As for the design I definitely want to start with a single page scroll through jumbotron panels. I wanted to keep the styling simple and image-focused so a quick swap of images will give me a completely fresh look with minimal effort. The images and videos I've chosen are all my own with some manipulation using Gimp, an open open source photo editor that I highly recommend checking out. I was able to do a lot of work with background removal to accomplish some really cool parallax effects! 

*********************************************************
<h1><center> Let's get started! </center></h1>
*********************************************************

I started with a totally empty repository and project directory with a typical app directory, .gitignore, and index.html in the root then installed my initial dependencies. 

``` npm install gulp del browser-sync merge-stream gulp-sass --save-dev ```
``` npm install bootstrap jquery```

The next step was to setup the gulpfile. Gulp and Sass thankfully have really easy to comprehend documentation so check them out! I'd hate to overload this post with recommendations that will be out of date in a year ;)

{% gist https://gist.github.com/JaredHarbison/02328a88553b1b40a26bfdfe4230065a %}

It really was as easy as that to get something up and I can't wait to tinker with it more. I wound up just hosting the site on github.io which was a total breeze. [Check it out](JaredHarbison.github.io) and if you're interested in the html/ css, check out the <a href="https://github.com/JaredHarbison/JaredHarbison.github.io" target="_blank">repo</a>! 



*********************************************************
<h1><center> That's all folks! </center></h1>
Need Help Picking a Tabletop Colour
Tags: homeoffice
Published: 2019-10-28 01:02:36

Hey peeps, I'm gonna buy a motorized standing desk with some award points I got from work. Which colour top should I go with? Mind chiming in on the Twitter poll? 🙏

{% twitter 1188599858128703488 %}

Here is the desk, [MotionGrey Adjustable Dual Motors Electric Sit to Stand Computer Office Standing Desk](https://www.bestbuy.ca/en-ca/product/motiongrey-adjustable-dual-motors-electric-sit-to-stand-computer-office-standing-desk-grey-frame-white-table-top-included/13366716)

And here are the tabletop colours (both colours are in the Tweet. The liquid tag just doesn't show it).

{%twitter 1188600257980063744 %}
My Initial experience with automatized tests
Tags: testing
Published: 2019-10-28 00:58:45

---
title: My Initial experience with automatized tests
published: true
description: A little about my history with automatized tests and my initial experience with it.
tags: ['#testing']
---

My goal with this article is to talk a little about my history with automatized tests and my initial experience with it.

This post was originally published in my blog [davidcosta.com.br](https://davidcosta.com.br/en/my-initial-experience-with-automatized-tests/).

---

I have working with programming since 2013, starting with PHP like home office for an E-commerce system integrated with ERP for a physical store. When I started programming I didn’t realize how many problems can show up that is developing a system is, for the most part, for human mistakes. As I was progressing in my career the projects grew in complexity, em the number of users and potential loss involved. The capacity to monitor issues was not humanly possible. Something was needed to be done to avoid many problems.

What makes me wake up to life was work in the SPA project with vanilha.js(Pure JavaScript)What was more complicated to be done with this project was to be able to change some without break an existing feature. Once this, happening it was a big loss of time. The process to launch any version depended on Apple’s review and approve the new updates. What it could late the launch in 1 to 5 days And when something has changed request from them, this could be slower.

This app was constituted by router system, forms, images upload and real-time data. Even using the best pattern of programming that I knew, it was always difficult to keep the feature’s consistency while was needed to do some new. I felt that with each new feature the system became more macaronic. To avoid future problems it was needed to make long check manuals. Testing every form, every link, every button manually to guarantee that everything was working.

In this period, Google launches a new tool called Puppeteer, which came with the object run the Google Chrome by the terminal, it’s could make simulations and tasks. I don’t lose time and start to use it, writing the commands that were needed to Puppeteer could test the functionalities. And what it took 30 minutes testing now just finish it in 5 minutes.

Since then, I have been looking to test with another side and start to learn and test everything that I could. For any good programming and experienced it to be, they are conducive to make mistakes. That means one single error can cause very big problems for the client and consequently for the developer. In addition to this, when it is testing. it’s adding documentation right and wrongs ways to use the system and to avoid that each change keeps working at the same time. Now I just can’t work in any project with tests again.

---

I hope that you enjoy this sorted history of my experience with tests. In the future, I pretend to talk more about this topic. If you have a different experience or similar please I would like to hear it. How is writing testing for you? And How much value do you see with this for the first time?
What's a great show or movie you watched recently?
Tags: watercooler
Published: 2019-10-28 00:51:15

Photo by [Georgia Vagim](https://unsplash.com/@georgiavagim?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/popcorn?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)

I just finished watching Living with Yourself on Netflix.

Big 👍

{%youtube 5w54yW2Ur50 %}

What's a great show or movie you watched recently?
Square loading animation
Tags: css, animation, loading
Published: 2019-10-28 00:49:50


I fork and study this post, write my practice project

{% link https://dev.to/webdeasy/9-satisfying-css-animations-for-relaxation-5ggl?utm_source=digest_mailer&utm_medium=email&utm_campaign=digest_email %}

This is my practice project
{% codepen https://codepen.io/flymaple/pen/zQJrRR default-tab=css,result %}
How To Add a Health Check to Your Node.js App
Tags: javascript, softwareengineering, node, programming
Published: 2020-02-12 21:33:22

---
title: How To Add a Health Check to Your Node.js App
published: true
date: 2019-10-28 00:14:23 UTC
tags: javascript,software-engineering,nodejs,programming
canonical_url: 
---

[![](https://cdn-images-1.medium.com/max/2600/0*ruQwlYBMeaG_e-oN)](https://medium.com/better-programming/how-to-add-a-health-check-to-your-node-js-app-5154d13b969e?source=rss-3a534b5053e6------2)

Check that your app is running at a glance without digging into code

[Continue reading on Better Programming »](https://medium.com/better-programming/how-to-add-a-health-check-to-your-node-js-app-5154d13b969e?source=rss-3a534b5053e6------2)
Miglior Tritacarne su Amazon
Tags: ios
Published: 2019-10-27 23:29:56

Venite a visitare il sito https://www.migliortritacarne.it/ per acquistare i miglior tritacarne in commercio sul mercato italiano!

Per ottenere una carne macinata fresca e fresca, il tritacarne è un dispositivo utile da non perdere nella tua cucina. Il tritacarne elettrico è disponibile in diversi modelli :

Utensile da cucina affettatrice per verdure con tritacarne manuale tritacarne manuale tritacarne
<h2>Miglior Tritacarne</h2>

Il tritacarne offre un modo rapido ed efficiente per elaborare la cottura della carne.
Facile da smontare e pulire, igienico e resistente con manico in legno.
È perfetto per carne, pepe, verdure, spaghetti, salsiccia e così via.
Ottimo sia per uso commerciale da ristoranti, macellerie o semplicemente per uso domestico quotidiano.

Caratteristica:

Materiale: PC + ABS + PP
Materiale lama: acciaio inossidabile
Colore: verde
Dimensioni: 13 * 23,7 cm La

confezione include: 

1 x tazza di alimentazione transperante
1 x coperchio protettivo
1 x base per tritacarne 
1 x manico a manovella
1 x lama in acciaio inossidabile
1 x lama per foro piccolo
1 x lama per foro grezzo
1 x coperchio per lama
1 x asta di alimentazione
1 x imbuto di riempimento per salsiccia

GHISA
ACCIAIO
+ corpo spremipomodoro opzionale

Componenti principali
Le caratteristiche variano a seconda dei modelli

il motore
in ghisa stagnata o acciaio inossidabile :
Corpo
Vite di alimentazione
Tappo a vite
in acciaio inossidabile autoaffilante l:
Piatto
Lama
in plastica o acciaio inossidabile :
Hopper
Base
La produzione professionale italiana di tritacarne elettrica proposta da Colella garantisce, dopo l'acquisto, di trovare facilmente ricambi compatibili.
Ultra Compressed - Best website for free Highly Compressed PC Games and Apps
Published: 2019-10-27 23:00:12

Ultra Compressed is one of the best websites which provide highly compressed pc games and apps. You can find highly compressed games for Mac as well and some apps. It provides highly compressed operating systems and much more. For more information visit the website below.

Best website for highly compressed PC Games : 

https://www.ultracompressed.com/category/highly-compressed-pc-games/
Mern(MongoDB, Express JS, React JS and Node JS) Stack
Tags: react, javascript, mern, node
Published: 2019-10-27 22:26:04

---
title: Mern(MongoDB, Express JS, React JS and Node JS) Stack
published: true
description: Boilerplate for getting started with MERN stack 👩‍💻👨‍💻
tags: react ,javascript ,mern ,node
---
Mernless provides a powerful Boilerplate which makes it easy to build isomorphic apps using Mongo, Express, React and NodeJS. It minimises the setup time and gets you up to speed using proven technologies. Mernless takes the pain out of development by easing common tasks used in many web projects, such as:
- Scalable and Maintainable Mern architecture
- Robust routing
- Database caching
- JWT authentication
- (Redux, Mail, Swagger, Docker, Travis) integration
- Command-line interface

GitHub : https://github.com/getspooky/Mernless
Documentation : https://getspooky.github.io/Mernless/