teleren/devto huggingface dataset:
File > New Project > API v0.1.0
Tags: discuss, webdev, help
Published: 2019-01-22 20:07:41

---
title: File > New Project > API v0.1.0
published: true
description: Decisions, decisions, decisions...
tags: discuss, webdev, help
---

So, it's 2019 and your boss just told you we need a new API that does CRUD operations as well as a WebSocket server.

Do you reach for Node.js? PHP with Laravel as the ORM, maybe? Definitely go for the library `ws` if you're going JavaScript. GraphQL! That's the hot new thing!

**Requirements**
- Must able to do CRUD operations
- Serve up JWT tokens for authentication of course
- Web Socket layer

If your boss told you he'd need an API with the above reqs, how would you build it with today's tools and technology?
Get a ruby method block source
Tags: ruby
Published: 2019-01-22 19:49:10

---
title: Get a ruby method block source
published: true
description: 
tags: Ruby
---


## Overview

I try it.

`block_source.rb` (require RUBY_VERSION >= '2.6.0'

```ruby
def inspector(ast:, &block)
  ast.children.each do |child|
    next unless child.instance_of?(RubyVM::AbstractSyntaxTree::Node)
    yield child
    inspector(ast: child, &block)
  end
end

def find_node(ast:, type:, lineno:)
  inspector(ast: ast) do |node|
    return node if node.type == type && node.first_lineno == lineno
  end

  nil
end

def extract_source(node:, source:)
  first_lineno = node.first_lineno - 1
  first_column = node.first_column
  last_lineno = node.last_lineno - 1
  last_column = node.last_column - 1

  if first_lineno == last_lineno
    source[first_lineno][first_column..last_column]
  else
    src = ' ' * first_column + source[first_lineno][first_column..]
    ((first_lineno + 1)...last_lineno).each do |lineno|
      src << source[lineno]
    end
    src << source[last_lineno][0..last_column]
  end
end

module Kernel
  # RUBY_VERSION >= '2.6.0'
  def block_source
    @file_specs ||= {}
    bl = caller_locations.last
    source = @file_specs.dig(bl.path, :source) || File.readlines(bl.path)
    @file_specs[bl.path] ||= { source: source, ast: RubyVM::AbstractSyntaxTree.parse(source.join) }
    node = find_node(
      ast: @file_specs.dig(bl.path, :ast),
      type: :ITER,
      lineno: bl.lineno
    )
    extract_source(node: node.children[1], source: source) if node
  end
end
```

Usage

```ruby
require_relative 'block_source'

def foo
  pp block_source
end

foo { 'hello' }   #=> " { 'hello' }"
foo { |i| i * 3 } #=> " { |i| i * 3 }"
foo               #=> nil
```

## Detail

First, get a caller information by `bl = caller_locations.last`.

```ruby
bl = caller_locations.last
```

Second, find `ITER` node. (`ITER` node is method call with block.)

```ruby
node = find_node(
  ast: @file_specs.dig(bl.path, :ast),
  type: :ITER,
  lineno: bl.lineno
)
```

`find_node` implement is simple. call `inspector` and find node which match conditions.

```ruby
def find_node(ast:, type:, lineno:)
  inspector(ast: ast) do |node|
    return node if node.type == type && node.first_lineno == lineno
  end

  nil
end
```

Finarlly, extract block source from `ITER`. (`ITER` node has block body in a second children element.

```ruby
extract_source(node: node.children[1], source: source) if node
```

## TODO

Currently, it isn't possible to get a column number from the information of the `caller_locations`. so, this case not working.

```ruby
foo { 'hello' }; bar { 'world' }
```

```
" { 'hello' }"
" { 'hello' }"
```
End-to-End Testing with Cypress and Auth0
Tags: cypress, auth0, react, javascript
Published: 2019-01-22 19:47:18

---
title: End-to-End Testing with Cypress and Auth0
published: true
description: Learn how to programmatically authenticate against Auth0 in your Cypress tests in a manner that adheres to both Cypress and Auth0 best practices.
tags: #cypress #auth0 #reactjs #javascript
canonical_url: https://auth0.com/blog/end-to-end-testing-with-cypress-and-auth0/
---

This post discusses how to authenticate against Auth0 in your Cypress end-to-end tests successfully. You will use a small sample React application to illustrate patterns you can use to programmatically log your user into Auth0 while running Cypress tests, in a manner that adheres to most Cypress and Auth0 best practices. 

[Read on 🔬](https://auth0.com/blog/end-to-end-testing-with-cypress-and-auth0/?utm_source=dev&utm_medium=sc&utm_campaign=testing_cypress)

![End-to-End Testing with Cypress and Auth0](https://thepracticaldev.s3.amazonaws.com/i/xn1fzym1w8zh8tinzjmt.png)
What I Learned Building a Side Project Without a Designer
Tags: react, javascript, sideprojects
Published: 2019-01-22 18:27:42

---
title: What I Learned Building a Side Project Without a Designer
published: true
description: building a site without a designer
tags: react, javascript, side projects
---

## The Project

I LOVE the Oscars. When I say I love the Oscars, I really love the Oscars. My roommate and I watch every Oscar nominee in all 24 categories every year. It's one of my favorite traditions however, we usually track our progress by crossing off the movies we have seen from a physical list. 

Over the weekend I decided to make a website to help us track our progress!

Final Product: [www.theoscarwatch.com](http://www.theoscarwatch.com/)

## Round 1: Myself as a Designer

I had a ton of fun building the site, but of course as a React developer all I cared about was how cool and fast I could move data around the site. Finally when all was said and done this was a snapshot of the result.

![first try](https://thepracticaldev.s3.amazonaws.com/i/fr25ehpcdho8ky3plm9w.png)

I was really proud of how fast and concise the site worked. However, the reaction from the rest of my friend group (non-developers) was lukewarm. Multiple comments of "can we spruce this up?" or "oh wow, nice good work". So finally, unhappy with how the site looked I called in one of my designer friends on Monday, the day before the nominations came out, to give me a hand.

## Round 2: Working with a Designer: Electric Boogaloo

I had my designer friend come over after sending him a link the night before. He mocked up a quick design for how to change things. The first was killing the modal that displayed the data in favor of a dropdown menu. The second was making the scrolling area smaller. The third was adding a countdown timer. And the fourth was a revamping of the color scheme.

The final result looked like this:

![final](https://thepracticaldev.s3.amazonaws.com/i/bhv1lq6zxfcyk5ulmybc.png)

Much cleaner, better looking and most importantly...much better received by non developers!

The whole thing reminded me of the scene from Silicon Valley where none of the non-engineers understand the awesomeness of the compression app. 

Long story short, as developers we sometimes take designers for granted and we need to appreciate that they can bring value that we don't even think about.

OUR finished work: [www.theoscarwatch.com](http://www.theoscarwatch.com/)
Giving Go another chance: setting everything up
Tags: go, timetracking, vscode
Published: 2019-01-22 17:52:38

---
title: Giving Go another chance: setting everything up
published: true
description: I'm writing a simple time tracking tool and rediscovering Go at the same time.
tags: go, golang, time tracking, vscode
series: Making a time tracking tool in Go
---

First things first: I need to be able to build and run Go programs. I'm using
macOS, so installing Go was very quick:

```
$ brew install go
```

Seems to work:

```
$ go version
go version go1.11.4 darwin/amd64
```

Now I need to hook it up with my editor. I'd like to have at least some basic features, like format code on save and build and run from the editor. Normally I use Sublime Text 3, but after quickly checking the [installation instructions](https://margo.sh/b/hello-margo/) I decided to rather try Visual Studio Code where I can set everything up with one click.

It's been laying around on my hard drive for a while now and now I finally have an excuse to try it out. So, not only a new language, a new editor as well. Yay!

Setting up the extension took just a couple of minutes, it was quick and absolutely painless. Making the editor format the code on save, on the other hand, was a whole different story. It took me a really long time fiddling with the settings, googling, reading [relevant issues](https://github.com/Microsoft/vscode-go/issues/1419) on Github and so on. VS Code was very helpful most of the time, installing relevant tools, highlighting errors in my config and so forth. The only thing it refused to do is to format my code on save.

It seems I've tried everything and I just gave up and went to bed. As it turned out next morning, all it needed is a restart. How dumb of me. I guess it's that my never dying faith in software and that developers for once will get it right. No such luck this time. At least Windows 95 was honest about this. VS Code makes it look like no restart is needed and everything is kinda working but not 100%. More like 93.76%.

In the end I have it all working: format on save, build, go to definition and even full blown IntelliSense, that autocompletes almost everything for me. Nice!

Let's get to coding next time.

---

This is how much I rely on Google these days to get this little bit of work done:

- go tutorial
- homebrew install golang
- goimports
- goreturns
- goformat
- vscode go fmt on save
- vscode go format on save not working
- go vet
- go build release

---

Time spent: 3 hours
Total time spent: 3 hours
KendoReact Components (Functional Hooks Style)
Tags: progress, kendoreact, telerik, kendo
Published: 2019-01-22 17:36:11

---
title: KendoReact Components (Functional Hooks Style)
published: true
description: A cleaned up version of many KendoReact StackBlitz doc demos
tags: Progress, KendoReact, Telerik, Kendo
---

## Splitter

[Splitter](https://stackblitz.com/edit/2019-r1-splitter?file=app%2Fmain.js)

## Dialog
[Dialog](https://stackblitz.com/edit/2019-r1-dialog?file=app%2Fmain.js)

## Window
[Window Resizable](https://stackblitz.com/edit/2019-r1-dialog-window-resizable?file=app%2Fmain.js)

## DropDownButton
[DropDownButton (class)](https://stackblitz.com/edit/2019-r1-drop-down-button?file=app/main.js)
[DropDownButton (functional)](https://stackblitz.com/edit/2019-r1-drop-down-button-hooks?file=app/main.js)

## Toolbar

[Toolbar](https://stackblitz.com/edit/2019-r1-toolbar?file=app%2Fmain.js)

## Grid
[Grid Column Menu (Filter) (WIP)](https://stackblitz.com/edit/2019-r1-grid-column-menu?file=app%2Fmain.js)
[Grid Columns Locked](https://stackblitz.com/edit/2019-r1-grid-columns-locked?file=app%2Fmain.js)

## Masked Inputs

[Masked Inputs](https://stackblitz.com/edit/2019-r1-masked-inputs?file=app%2Fmain.css)
[Masked Input and Form](https://stackblitz.com/edit/2019-r1-masked-inputs-form?file=app%2Fmain.js)

## SplitButton
[SplitButton](2019-r1-kendo-ui-split-button)

## Tree
[Tree](https://stackblitz.com/edit/2019-r1-tree?file=app/main.js)

## Upload
[Upload](https://stackblitz.com/edit/2019-r1-upload?file=package.json)
Tweet in bold, italics and strikethrough text
Tags: showdev, webdev, javascript
Published: 2019-01-22 16:37:19

---
title: Tweet in bold, italics and strikethrough text
published: true
description: tweetfancy.io - Tweet in bold, italics and strikethrough text
tags: #showdev #webdev #javascript
---

_**TL;DR** - I built a tool - [tweetfancy.io](https://tweetfancy.io/) to tweet in bold, italics and strikethrough text._

Ever fancied tweeting with **bold**, _italics_ or ~~strikethrough~~ text? 

Twitter doesn't allow its users to format tweets. But having an option to _emphasize_ or **call out** a word or a phrase in a tweet might come in handy at times.

# Announcing tweetfancy.io

I recently realized that the UTF charset has [characters and symbols](https://en.wikipedia.org/wiki/Mathematical_Alphanumeric_Symbols) that look like **bold**, _italics_ or ~~strikethrough~~ ascii characters. So I built a tool that generates these characters which could be copied and pasted into almost any website out there.

- Write your original text in markdown
- The editor will generate text for you to copy/paste
- Tweet directly from the editor
- Copy/Paste the generated text into any website (FB/Insta/etc)

_Note: The generated characters are mathematical symbols and not actual English alphabets. So if you run them by a screen reader, you'll find that the reader reads them out by their symbol name. But then, all screen readers struggle reading smileys too (🎉🔥🚀🦄😎) and that doesn't stop us from using smileys. So,we might use this as well._

Here's the link - [tweetfancy.io](https://tweetfancy.io/)

Go bonkers tweeting in **bold**, _italics_ or ~~strikethrough~~! Happy tweeting! 🎉
Announcing v0.5 of my Metadata Reflection API polyfill for TypeScript decorators
Tags: typescript, javascript, announcement, opensource
Published: 2019-01-22 15:44:31

## What is Reflection

[@abraham/reflection](https://www.npmjs.com/package/@abraham/reflection) is a lightweight [ES Module](https://hacks.mozilla.org/2018/03/es-modules-a-cartoon-deep-dive/) implementation of [reflect-metadata](https://github.com/rbuckton/reflect-metadata/) API so you can ship [decorators with TypeScript](https://www.typescriptlang.org/docs/handbook/decorators.html) with fewer bytes.

## Usage

Install `@abraham/reflection` through npm:

~~~bash
npm install @abraham/reflection
~~~

Import into your code:

~~~ts
import '@abraham/reflection';
~~~

Check out how to write a decorator:

{% link https://dev.to/scleriot/typescript-method-decorators-example-1imc %}

## What's Changed

* Update test names
* Add import example
* enable type-checking in tests
* Fix global Reflect type
* Convert MetadataValue to generic
* Cleanup code layout
* Use existing metadata maps if they exist
* Cleanup linting
* Add pkg-ok on CI
* Enable automerge of devDependencies
* Update dependencies

{% github abraham/reflection %}
Sherlock : Stalk through social media
Tags: javascript
Published: 2019-01-22 15:10:36

---
title: Sherlock : Stalk through social media
published: true
description: find usernames across social networks
tags: javascript
---

<h1 align="center">sherlock</h1>
<p align="center">Find usernames across social networks.</p>

Source code: https://github.com/abhijithvijayan/sherlock

![](https://i.imgur.com/IvlDIbA.gif)
Locution as a service
Tags: advice, feedback, brainstorming, startup
Published: 2019-01-22 14:59:46

---
title: Locution as a service
published: true
description: 
tags: #advice, #feedback, #brainstorming, #startup
---

I was searching for a platform to do this, but couldn't find it.

Then I want to create a platform where:
- Customer request for a reading of certain text, and an offer.
- People apply to the offer and set a time frame to deliver.
- Customer choose between people who offered based in time frame and portfolio.

Locution as a service. 
Freelance working for locution professionals.

If you know some service like this in the web, please, comment with a link, I couldn't find one.

The idea comes from:
{% link https://dev.to/m1guelpf/building-a-product-in-a-week-5eo1 %}

What do you think about it? 
Would it be useful?
Kutt.it URL Shortener Browser Extensions
Tags: javascript
Published: 2019-01-22 14:52:32

---
title: Kutt.it URL Shortener Browser Extensions
published: true
description: Best time to switch to Kutt.it, another modern Open-Source URL shortener.
tags: javascript
---
<div align="center"><img width="120" src="https://github.com/abhijithvijayan/kutt-extension/blob/master/src/assets/logo.png?raw=true" /></div>

<p align="center">Browser extension to to shorten URLs for <a href="https://kutt.it">Kutt.it</a></p>

Source code : https://github.com/abhijithvijayan/kutt-extension

![](https://thepracticaldev.s3.amazonaws.com/i/rdkhpbdounh5fap8tb5c.png)

## Features
- Cross Browser Support
- Minimal UI
- Instant QR Code
- Supports Password for URLs
- Free and Open Source
- WebExtensions API

## Browser Support

[![Chrome](https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png)](https://chrome.google.com/webstore/detail/kutt/pklakpjfiegjacoppcodencchehlfnpd) | [![Firefox](https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png)](https://addons.mozilla.org/firefox/addon/kutt/) | [![Opera](https://raw.github.com/alrra/browser-logos/master/src/opera/opera_48x48.png)](CONTRIBUTING.md#for-opera-users) | [![Yandex](https://raw.github.com/alrra/browser-logos/master/src/yandex/yandex_48x48.png)](https://chrome.google.com/webstore/detail/kutt/pklakpjfiegjacoppcodencchehlfnpd) | [![Brave](https://raw.github.com/alrra/browser-logos/master/src/brave/brave_48x48.png)](https://chrome.google.com/webstore/detail/kutt/pklakpjfiegjacoppcodencchehlfnpd) | [![vivaldi](https://raw.github.com/alrra/browser-logos/master/src/vivaldi/vivaldi_48x48.png)](https://chrome.google.com/webstore/detail/kutt/pklakpjfiegjacoppcodencchehlfnpd) |
--- | --- | --- | --- | --- | --- |
55 & later ✔ | 52 & later ✔ | 42 & later ✔ | Latest ✔ | Latest ✔ | Latest ✔ |


Extensions are published in respective stores for downloading...
How to create an equal height grid using Flexbox CSS
Tags: css, flexbox, grid
Published: 2019-01-22 14:45:33

---
title: How to create an equal height grid using Flexbox CSS
published: true
description: Learn how to create an equal height grid using Flexbox CSS.
tags: CSS, Flexbox, Grid
---
{% youtube OmmM_a_AMNE %}

If you enjoyed this screencast, consider subscribing to my [YouTube channel]
(https://www.youtube.com/channel/UC2jJoQlzvLPvnYfowAEVaOg) for more screencasts about HTML, CSS, and JavaScript.
Introducing a new Visual Studio Code Theme: Retro Wave Junkie
Tags: vscode, theme
Published: 2019-01-22 14:23:20

---
title: Introducing a new Visual Studio Code Theme: Retro Wave Junkie
published: true
cover_image: https://github.com/kasuken/Visual-Studio-Code-Themes/raw/master/retro-wave-junkie/RetroWaveJunkieMainScreen.jpg
description: 
tags: #vscode #theme
---

In the last period I listen a new kind of music that I discovered, called: Retro Wave.
I really appreciate it.

Inspired by this music and the color of the Retro Wave logo, I created this theme for Visual Studio Code.

![](https://github.com/kasuken/Visual-Studio-Code-Themes/raw/master/retro-wave-junkie/RetroWaveJunkieMainScreen.jpg)

Download now this awesome theme!!!
This is the link: [https://marketplace.visualstudio.com/items?itemName=emanuelebartolesi.retro-wave-junkie](https://marketplace.visualstudio.com/items?itemName=emanuelebartolesi.retro-wave-junkie)

You can also find the source code [on my GitHub Repository](https://github.com/kasuken/Visual-Studio-Code-Themes).
[UPDATE] LaravelCollections.com crossed 500 links
Tags: laravel, php, sideprojects, update
Published: 2019-01-22 13:23:17

Hi All,

I am very happy to announce that [LaravelCollections.com] (https://laravelcollections.com/?utm_campaign=update-500links) has now more than 500 links to great Laravel resources.
This feat would not have been possible without users submitting resources they found.

Thank You.
⚡ Blitz Tips — RxJs Pipe Is Not A Subscribe!⚡
Tags: angular, typescript, rxjs, angular2
Published: 2019-01-22 14:00:45

---
title: ⚡ Blitz Tips — RxJs Pipe Is Not A Subscribe!⚡
published: true
tags: angular,typescript,rxjs,angular2
canonical_url: https://medium.freecodecamp.org/blitz-tips-rxjs-pipe-is-not-a-subscribe-125c89437a2c
---

### ⚡ Blitz Tips — RxJs Pipe Is Not A Subscribe!⚡

![](https://cdn-images-1.medium.com/max/1024/1*8WNtSRqKD9vfik5zLqDRzw.jpeg)<figcaption>Look! A lightning tip! (Original 📸 by <a href="https://unsplash.com/photos/iF5odYWB_nQ?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Max Bender</a>)</figcaption>

> This article is directed at the beginners trying to deeper RxJs knowledge but can also be a quick refresh or a reference to show to beginners for more experienced developers!

Today we are going to keep it short and straight to the point!

Currently I am working in a rather large organization with big amount of teams and projects (more than 40 SPAs) who are in the process of migration to Angular and therefore also RxJs.

This represents a great opportunity to get in touch with the confusing parts of RxJs which can be easy to forget once one masters the APIs and focuses on the implementation of the features instead.

[Read more...](https://medium.freecodecamp.org/blitz-tips-rxjs-pipe-is-not-a-subscribe-125c89437a2c)
Modify Page Orientation, Rotate Document Pages in your Java applications
Tags: java, api, programming, groupdocs
Published: 2019-01-22 13:11:51

---
title: Modify Page Orientation, Rotate Document Pages in your Java applications
published: true
description: post
tags: Java, api, programming, groupdocs
---

As an application developer, you may come across a business requirement for building utility application which could work with commonly used document formats. Such applications are especially useful on mobile devices and provide end users with a portable, light weight and swift avenue of document manipulation on the go. 

When we talk about utility features, we are considering functionalities like modifying the orientation of document pages (portrait, landscape) as well as rotating document pages and many more. One good example of a utility app is a document scanning and printing application, providing end users with the ability to rotate and orientate file pages which they wish to scan or print.

If you are a Java developer and you plan on incorporating similar features into your applications, consider GroupDocs.Merger for Java. It is a sophisticated document merger API for Java platform empowering you to merge, split or trim Microsoft Word, Excel, PowerPoint, PDF, EPUB, ODT, TXT, Diagram and Note format documents as well as move and swap specific document pages too. You have access to an array of basic and advanced features to absorb into any type of Java applications. Try free – http://bit.ly/2CFFpdU
What is your opinion about the developer learning/training offering these days?
Tags: discuss, learning
Published: 2019-01-22 12:45:33

---
title: What is your opinion about the developer learning/training offering these days?
published: true
description: There are a lot of learning and training resources these days but what is your opinion about it
tags: #discuss #learning
---

![](https://thepracticaldev.s3.amazonaws.com/i/3tfacm95iemf874pvurb.jpg)

Over the last few years, I have noticed an enormous change in the learning and training landscape. There has been an explosive growth in video courses. There are more books than ever, and more and more people decide to go for self-publishing instead of working with traditional publishers.

As someone that works on learning/training content, I would like to know what the community thinks about the offering these days? I would love to hear your opinion about questions such as:

- What is your overall feeling about the current learning/training offering?
- Does the current learning/training offering cover your personal learning goals and needs? If not, why not?
- Do you ever pay for learning/training content?
- What is your favorite learning platform and why?
- You can find courses about a given technology for as little as 10 EUR and as much as 400 EUR. What makes you go for one or the other?
- Did you ever regret paying for a video course or book? Why?
- What do you like and dislike the most about video courses? What about books?
- Do you feel that the learning/training market is oversaturated or undersaturated?


Thanks for sharing your thoughts!