teleren/devto huggingface dataset:
How much blockchain developers REALLY make?
Tags: blockchain, ethereum, salary, job
Published: 2019-06-30 16:15:02

---
title: How much blockchain developers REALLY make?
published: true
description: 
tags: blockchain, ethereum, salary, job
---

There are tons of report claiming that blockchain dev make a ton of money. But is it really true? In [this article](https://eattheblocks.com/how-much-blockchain-developers-really-make/), I give a bit of context, for example showing that salary surveys forget to mention that they survey mostly developers in SF and other expensive cities in the US.
Hand and wrist pain?
Tags: help, productivity, advice
Published: 2019-06-30 15:53:38

For a couple of days already I’ve had a pretty bad pain in my right hand, fingers, wrist, and forearm. I know the culprits: writing code on a MacBook flat keyboard, using the trackpad, and on my free time, using my phone and playing video-games.

I’m writing this on my phone with my left thumb only, my right hand wrapped tightly to ease the pain. I simply cannot use my right hand. I’ve even woken up multiple times during the past couple nights because of the pain.
But how will I ever achieve my goals if I can’t write code? “To get better, write more code”, is the best advice, but what if one can’t?...

So I’m looking for advice from people who suffer or have suffered similar problems. How do you keep going? Ice? Heat? Fancy ergonomic keyboard? *Speech-to-text code?*
Facebook Graph API Fetch Events in a Location
Tags: react, facebook, graphapi, api
Published: 2019-06-30 15:38:47

Hello guys, am a beginner to dev and learning and same time building an app. I want to fetch events on facebook and display on my app using **facebook graph API** but not sure if missing anything, I have created a facebok app for this purpose.
The documentation  for getting the is this [Documentaion](https://developers.facebook.com/docs/graph-api/reference/event/). 

What i intend is to get fetch events based on location and display those events  but from the [Documentaion](https://developers.facebook.com/docs/graph-api/reference/event/) am not really sure how to achieve this, how to set the fetch url that the events could be fetched.
 The areas i need help 
*What permission i need to do this 
*What and what is needed to get this data (how will the url like)
*any other ways to achieve this  ?
*Your recommendation 

Any recommendation will really be appreciated 
Thanks for your time
Happy DAY - My Github Project listed in BlackArch OS
Tags: github, security, programming, python
Published: 2019-06-30 15:24:20

---
title: Happy DAY - My Github Project listed in BlackArch OS
published: true
description: 
tags: GitHub,security,programming,Python
---


Hard to believe at least, for me.
I was checking recent traffic on one of my tools "Stardox" on GitHub. I noticed some traffic from BlackArch's official website. 
I was like what? 
Is it a fake site or a joke? 
Opened up their tools page on their official website, and found Stardox listed there as a Recon ( Information Gathering ) Tool. 
This is the first time when a tool I programmed got listed in a Linux based distribution.
It feels amazing. Trust me nothing can be more good than this for now.❤

Project :: https://github.com/0xPrateek/Stardox
VIM & Visual Studio Code Tips & Tricks (With Video / GIF)
Tags: vim, vscode, javascript, tips
Published: 2019-06-30 13:45:19

---
title: VIM & Visual Studio Code Tips & Tricks (With Video / GIF)
published: true
description: VIM & Visual Studio Code Tips & Tricks (With Video / GIF)
tags: vim, vscode, javascript, tips
cover_image: https://hashnode.imgix.net/res/hashnode/image/upload/v1561901247664/RulZ-QNLa.png?w=1600&h=840&fit=crop&crop=entropy&auto=format,enhance&q=60
---

This post is going to be a collection of VIM And Visual Studio Code tips that I use daily. And **it will be updated frequently**. So stay tuned. You can follow me here or on twitter  [@muhajirdev ](http://twitter.com/muhajirdev) if you want. I'd really really love to hear your feedback here 

Installed Extenstion in Visual Studio Code:
- [VSCodeVim](https://github.com/VSCodeVim/Vim) 

## Delete In Tag


![dit-2.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1561899637547/wu98ydxWG.gif)


## Delete Surrounding Tag

![dst-2.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1561899815957/rY6Rk-Qp8.gif)

*Update June 30th, 2019*
 
## Change single quote to double quote


![single-quote-to-double-quote.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1561905097925/PfR687VHY.gif)

*Update July 4th, 2019*

## Change Tag with Emmet

Note that you need to set the keyboard shortcut first. Press `cmd+shift+p` Then write `Preferences: Open Keyboard Shortcuts (JSON)`. And add the following 

```
[
...
 {
    "key": "shift+cmd+n",
    "command": "editor.emmet.action.updateTag",
    "when": "editorTextFocus"
  },
...
]
```

My full keyboard shortcuts can be seen on my [github dotfiles](https://github.com/muhajirdev/dotfiles/blob/master/vscode-keybindings-mac.json)

![change-tag.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1562235200819/Dpi0XgmSj.gif)

*Update July 11th, 2019*

## Go to matching tag with Emmet

Similar to tips above. I use `cmd+m` as the shortcut here. You can check the keyboard shortcut file on my github dotfiles.

![matching tag.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1562811003814/UHXvSZYgk.gif)

## Copy And Paste with VIM 

![copy-paste.gif](https://cdn.hashnode.com/res/hashnode/image/upload/v1562926540034/Y0SvA7QX0.gif)


# Update

I have created [VSCode.xyz](https://vscode.xyz) as vscode tips and tricks portal. Check it out.

**This post will be updated** with more tips and tricks. Stay tuned. 

Like and share if you found it useful.

If you have additional tips. You can put it on the comment below. I might can include it too in this post :)
Unity2019は追加モジュールのAndroid SDKでsdkmanagerを実行するのが面倒
Tags: unity3d, unity2019
Published: 2019-06-30 12:18:00

---
title: Unity2019は追加モジュールのAndroid SDKでsdkmanagerを実行するのが面倒
published: true
tags: Unity, Unity2019
date: 20190630T12:18Z
canonical_url: https://qiita.com/shiena/items/38ba69ea96f672941dbb
---
# はじめに

Unity2019から追加モジュールとしてAndroid SDK/NDKをインストールできるようになりました。このAndroid SDKは`platforms;android-28`しか入っていないので他のAPIレベルを使いたい時はAndroid SDKにパッケージを追加インストールが必要になります。
ですが、Windowsの場合は以下の理由によりとても分かりにくくなっています。

* インストールパスが深い
    * Unity2019.1.4f1の場合: `C:\Program Files\Unity\Hub\Editor\2019.1.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK`
* デフォルトの`C:\Program Files`にインストールすると管理者権限が必要

そこで`sdkmanager.bat`があるフォルダを管理者権限のコマンドプロンプトを開くエディタ拡張を作りました。

# Android SDKのフォルダを管理者権限で開くエディタ拡張

※追記

Unity2018から追加されたPackage Manager対応版も用意しました。

- [Unityから組込みAndroid SDKとlogcatをサッと開くエディタ拡張](https://qiita.com/shiena/items/8ec1e821702a213fa32f)

---

以下のスクリプトを`Assets/Editor`フォルダに保存してください。
メニューに追加された`Tools/Open android sdk folder as administrator`を実行すると`sdkmanager.bat`があるフォルダを管理者権限のコマンドプロンプトで開きます。
その後は`sdkmanager "platforms;android-25"`のように必要なパッケージをインストールしてください。


```cs:Assets/Editor/AndroidSDKHelper.cs
#if UNITY_2019_1_OR_NEWER && UNITY_ANDROID && (UNITY_EDITOR_WIN || UNITY_EDITOR_OSX)
using System;
using System.Diagnostics;
using System.IO;
using UnityEditor;

public static class AndroidSDKHelper
{
#if UNITY_EDITOR_WIN
	[MenuItem("Tools/Open android sdk folder as administrator", false, 100)]
	private static void OpenAndroidSdkFolderOnWindows()
	{
		var androidPlaybackEngineDirectory =
			BuildPipeline.GetPlaybackEngineDirectory(BuildTarget.Android, BuildOptions.None);
		var androidSdkTools = Path.Combine(androidPlaybackEngineDirectory, "SDK", "tools", "bin");
		var jdkPath = Path.Combine(androidPlaybackEngineDirectory, "Tools", "OpenJDK", "Windows");
		var cmd = Environment.GetEnvironmentVariable("ComSpec");

		if (!Directory.Exists(androidSdkTools) || !Directory.Exists(jdkPath) || !File.Exists(cmd))
		{
			return;
		}

		var process = new Process
		{
			StartInfo = new ProcessStartInfo
			{
				FileName = cmd,
				Verb = "runas",
				UseShellExecute = true,
				Arguments = $"/K cd {androidSdkTools} & set \"JAVA_HOME={jdkPath}\""
			}
		};
		process.Start();
	}
#endif

#if UNITY_EDITOR_OSX
	[MenuItem("Tools/Open android sdk folder", false, 100)]
	private static void OpenAndroidSdkFolderOnMac()
	{
		var androidPlaybackEngineDirectory =
			BuildPipeline.GetPlaybackEngineDirectory(BuildTarget.Android, BuildOptions.None);
		var androidSdkTools = Path.Combine(androidPlaybackEngineDirectory, "SDK", "tools", "bin");

		if (!Directory.Exists(androidSdkTools))
		{
			return;
		}

		var process = new Process
		{
			StartInfo = new ProcessStartInfo
			{
				FileName = "open",
				Arguments = $"-a Terminal {androidSdkTools}"
			}
		};
		process.Start();
	}
#endif
}
#endif
```

# 所感

Unityをバージョンアップする度にAndroid SDKのパッケージも追加インストールが必要になるのでUnity2018以前のように個別にAndroid SDKをインストールする方が楽なのでは？

Unity2018以前のAndroid SDKのセットアップについて -> [Unity - Manual:  Android environment setup](https://docs.unity3d.com/2018.4/Documentation/Manual/android-sdksetup.html)
What you need to know when you remove "You" profile from Chrome
Tags: internet, googlechrome
Published: 2019-06-30 14:34:04

---
title: What you need to know when you remove "You" profile from Chrome
published: true
tags: Internet,google chrome
canonical_url: https://kevinhq.com/what-you-need-to-know-when-you-remove-profile-from-chrome/
---

As all of us already know, Google Chrome created a profile called “You”, when you’re using it. Unless you decide to “browse as a guest”, all of your browsing data will be tied to it. When you signed in to Gmail account, this “You” profile will be replaced with the Google account you signed in.… 

[Read More »What you need to know when you remove profile from Chrome](https://kevinhq.com/what-you-need-to-know-when-you-remove-profile-from-chrome/)
Enabling AzueAD authentication with user interface and JWT bearer header
Tags: dotnet, azure
Published: 2019-06-30 09:40:05

The .NET Core framework allows for multiple authentication schemes in order to authenticate agains, for example, AzureAD and Facebook. The typical cookie-based option works great with user interfaces, and JWT is the go-to for API (user-less) authentication. What if you want to mix the way these schemes authenticate? 

I've been setting up a solution with a user interface built with Razor Pages and a few endpoints which I intend to run when called from an Azure Function App. Sure, I could split the application in to several applications and that would make a lot of sense from some perspectives, but adds lots of complexity to a single app. That approach would also require an additional Azure App Service, which I don't really need.

Configuring the application to support multiple schemes turned out a bit less intuitive than I initially expected. My first approach included setting up different schemes and trying to enforce them with a PolicyBuilder and/or [Authorize] attributes on the API controllers without success.

Turns out there was a small piece missing to the puzzle. As always, when stumbling upon the [solution on StackPath](https://stackoverflow.com/a/51897159/446730), it was obvious what piece was missing.

The key was to add another PolicyScheme and check for the Authorization HTTP header, and if it starts with "Bearer", forward the scheme selector:

```csharp
services.AddPolicyScheme("dynamic", "Dynamic Policy scheme", options =>
{
    // https://stackoverflow.com/questions/45695382/how-do-i-setup-multiple-auth-schemes-in-asp-net-core-2-0/51897159#51897159
    options.ForwardDefaultSelector = context =>
    {
        var header = context.Request.Headers["Authorization"].FirstOrDefault();
        if (header?.StartsWith("Bearer") == true)
        {
            return JwtBearerDefaults.AuthenticationScheme;
        }

        return OpenIdConnectDefaults.AuthenticationScheme;
    };
})
```

To make the dynamic scheme selector the default:
```csharp
services.AddAuthentication(options =>
{

    options.DefaultSignInScheme = CookieAuthenticationDefaults.AuthenticationScheme;
    options.DefaultAuthenticateScheme = "dynamic";
    options.DefaultChallengeScheme = "dynamic";
})
```

Now, each request will first pass through the `DefaultAuthenticationScheme`, which will determine the authentication scheme to use.

Are there any other ways to achieve this? Do you know of a better solution? Please share!
CSS Battle Ground - #1
Tags: showdev, html, webdev
Published: 2019-06-30 09:20:49

I am a fan of [CSSBattle.dev](http://cssbattle.dev) and been enjoying trying out my css skills on the awesome site. In this video, I recorded my screen while trying out their new challenges.

{% youtube J-h1Dfr4xxU %}

[Subscribe to my channel](http://bit.ly/oyetoketoby) and ensure you share.
I created an online markdown viewer and editor 📝
Tags: showdev, markdown, javascript, webdev
Published: 2019-06-30 09:09:53

## **[Marcdown 👻](https://liyasthomas.github.io/marcdown)**
### Lightweight markdown viewer and editor

For one of my blog post, I was searching for an online markdown viewer and editor. There were many heavy-duty editors, with tones of useless features, but none seems to be easy and fast with all essential features.

That's why I created an online markdown viewer and editor tool: [Marcdown](https://liyasthomas.github.io/marcdown) to create, edit, view, and save markdown files on the go with ease. [Marcdown](https://liyasthomas.github.io/marcdown) is WYSIWYG!

> WYSIWYG is an acronym for What You See Is What You Get. In computing, a WYSIWYG editor is a system in which content can be edited in a form closely resembling its appearance when printed or displayed as a finished product, such as a printed document, web page, or slide presentation.

![Dark mode](https://raw.githubusercontent.com/liyasthomas/marcdown/master/icons/screely2.png)

Forget all the hassle of working with complicated editors. Learn how to create, edit, view, and save markdown files within minutes!

[Marcdown](https://liyasthomas.github.io/marcdown) is an open-source markdown viewer and editor optimized for change and adaptability to fit your exact needs.

![Light mode](https://raw.githubusercontent.com/liyasthomas/marcdown/master/icons/screely.png)

With [Marcdown](https://liyasthomas.github.io/marcdown), now I can view and edit markdown files in all sizes for free; I can view, edit, create markdown files and download them from anywhere.

Viewing and editing markdown files is now as simple as 1, 2, 3!

1. Paste or type markdown on left.

2. View preview on right.

3. Download markdown file.

Bonus: 🌗 I also added an option switch to dark mode so that reading markdown files at night won't hurt your eyes!

### **[Demo 🚀](https://liyasthomas.github.io/marcdown)**

### Feel free to contribute on **[GitHub](https://github.com/liyasthomas/marcdown)**

{% link liyasthomas/i-m-writing-a-book-de-coding-the-passion-project-2c07 %}

---

If you want a heads up on my next projects, or just want to chat about the web, life and happiness make sure to follow me [@liyasthomas](https://twitter.com/liyasthomas) on Twitter 💙. If any of my projects helped you please consider [making a donation](https://paypal.me/liyascthomas).

![yep](https://media.giphy.com/media/XbxZ41fWLeRECPsGIJ/giphy.gif)

EDIT 0: Added highlightjs support: Inline codes and code blocks will now be highlighted automatically.
EDIT 1: Added separator line between editor and preview 🎉 Marcdown is a PWA. It works offline after first use. You can install it as a Web app on your phone or Desktop app on your PC. Click on the top-right **PWA button** to install as an offline app. Share your suggestions below & I'll implement them.
What is the most common error you see?
Tags: discuss
Published: 2019-06-30 08:24:09

---
title: What is the most common error you see?
published: true
description: What is the most common error you see people doing over and over?
tags: [discuss]
cover_image: https://thepracticaldev.s3.amazonaws.com/i/ahez6enl5yjon21m25x1.jpg
---

What is the most common error you see people doing over and over? Maybe some common wrong belief? 

> Photo by Sarah Kilian on Unsplash
C Dev
Published: 2019-06-30 07:38:27

Looks like a lot of us love to write code, and yes it is something very satisfying to solve small problems and when you put it all together we have taken a big leap for a Dev and a small leap for humanity.

I love to do that on the backend C#, C++,embedded C these languages challenge me and I love challenges.

If you want to build softwares which are responsive and fast I am your guy. Sorry, web Dev's I simply don't want to enter the HTML,CSS world but you never know
rspec-nlet: RSpec extension to define multiple helpers with let
Tags: rspec, rspeccore
Published: 2019-06-30 06:45:22

---
title: rspec-nlet: RSpec extension to define multiple helpers with let
published: true
description: RSpec extension to define multiple helpers with let.
tags: rspec, rspec-core
---

# rspec-nlet
One day I was testing some command line tool I built with Ruby and I tried to write a test code like this.

```ruby
let(:msg, :status) { Open3.capture2e(command) }
```

But I realized RSpec didn't allow you to define multiple helpers with `let` at once.

So I created a gem for it! [rspec-nlet](https://github.com/masakazutakewaka/rspec-nlet)
I'm aware that the use cases of this gem is very rare haha. 
 
# Usage
You can define a single helper or multiples helpers with it at once.
You get errors if the names and returned values from the block don't match.

You can read [README](https://github.com/masakazutakewaka/rspec-nlet#usage) for details.

```ruby
# define multiple helpers
> let(:one, :two, :three) { [1,2,3] }
> one # => 1
> two # => 2
> three # => 3

# define a helper
> let(:single) { 'single' }
> single # => 'single'

# raise an error when too few names are passed
> let(:too, :few) { [1,2,3] }
> few # => StandardError (Too few names)


# raise an error when too many names are passed
> let(:too, :many) { [1] }
> many # => StandardError (Too many names)

```


## Note
This feature was actually proposed to rspec-core in the past.

https://github.com/rspec/rspec-core/issues/1650

But it was rejected for a couple of reasons:

- `lets` is not a good name
- not so many use cases
-  handling corner cases

But it can live outside as a gem!

Thank you for reading!

## references
- https://github.com/rspec/rspec-core/issues/1650
How Did I Recover From An Alcohol Party And Get Back To Work The Next Day
Tags: work, life, health
Published: 2019-06-30 06:29:14



Even though I know I should not drink too much, sometimes I would just leave all the rules behind and enjoy the party.

So now what? I need to recover from that.


## Soup 

Usually, I have muffins and coffee for breakfast. In the morning after the party night, those are the last thing I want. The only thing came to my mind is soup.

Soup is easier to digest and absorb, provides nutrition, energy and water.


## Sports & Energy Drink

Water is crucial to clean up the waste and residual alcohol in the body, but pure water is not enough. I need something to wake up my tongue. 

Sports drink to supply the body inorganic salt, vitamins as well as water, also taste good.


## Vitamin Supplements

I have some vitamin supplements with me, just took some as usual.


## Sleep 

Alcohol genuinely helps sleep, so no worry about it. Just get a comfortable place the body knows what to do.



Work hard and don't forget to have fun. Overdrinking alcohol is not encouraged still.🐒
Why d3's geoContains function does not work with US county data.
Tags: d3, javascript, react, datadrivendesign
Published: 2019-06-30 03:41:42

---
title: Why d3's geoContains function does not work with US county data.
published: true
description: A solution on how to determine if a set of coordinates is in a particular county item.
tags: #d3 #javascript #react #datadrivendesign
---

This is using <a href="https://d3js.org/us-10m.v1.json">d3js.org</a>'s US json topography and d3 version 5.9.5.  I have posted the solution to the gitHub repo for d3, I wanted to get this out to as many people as possible so no one has to waste time trying to figure it out.

So, I have an issue and a "hacked" solution that worked for me.

I have several (100) cities that I would like to color the county they are in based on a score that they are given in an array.

I call geoContains with the following parameters: geoContains(county, points).  When mapped, several counties now "contain" New York City (pretty much the "rust belt" and along the northern border).

I dug through the code posted here and noticed the following issue when comparing it to Json topography data:

geoContains line 37: This is where the coordinates of the polygon are passed to the polygonContains (object.coordinates);

polygonContains line 2: This takes the length of the polygon array that was passed in (object.coordinates).  For all polygons in the above-referenced Json file, the length of this array is 1 and it contains another array that has all the coordinates to create the polygon.  This is where the error occurs.

I've gotten around this by passing the correct coordinates array into the polygonContains function rather than the array that holds the array or going through the geoContains function.  It works beautifully.

I wanted to point this out as an issue and also give people the cause and eventual solution to the problem.  I'm just a newb programmer (less than 6 months programming, self taught, and one week working in d3), so I am not sure if I am doing this correctly.  I spent a lot of time combing the internet trying to figure out what was wrong, so I'm hoping the above helps someone else out.
Implementing LRU cache in JavaScript
Tags: beginners, javascript, algorithms, webdev
Published: 2019-06-30 02:51:30


**LRU** is the acronym of *Least Recently Used cache*. The cache is used everywhere, let's try to implement that in Javascript. In simple steps -

- Create a data structure to hold the cache data with the initial limit.
- Provide functionalities for adding to cache, getting an element from the cache, removing the least used element from the cache and iterating through the cache.
- We implement the functionality by mimicking `Doubly LinkedList` and a `Map(Object)`

---

Read and write operations has to be in O(1) time complexity. 
DoublyLinkedList for **write/remove** and **Map(object)** for read operation makes this possible.

## Identifying LRU item from the cache:

In a Doubly Linked list make head as most recently used and tail as least recently used.

1) Do every insertion at the head.

2) On every read or update operation detach the node from its position and attach at the head of the LinkedList. Remember, LRU is indicated in terms of both read and write operations to the cache.

3)When cache limit exceeds remove a node from the tail

4) Store `key: Node` relation in the cache map. So that retrieval is possible in O(1).

 
![LRU Cache visualized as map and LinkedList](https://miro.medium.com/max/2628/1*sXq2W2FnlpV98RxJkA4uBA.png)


## LRU Implementation
{% gist https://gist.github.com/udayvunnam/a58c2a1c3044853c9d9efdc3c74e559e %}

## LRU Usage
{% gist https://gist.github.com/udayvunnam/68a5b6b237dbe2921ecd178467a651ea %}

As we are adding the 4th element in a cache with limit 3, which element do you think is removed ????????????

**Yes, it is ‘b’.**

Since ‘a’ is read recently and ‘c’ is the last added item. ‘b’ becomes the element that isn’t used recently by either read or write operations and hence available for deletion from the cache.


--- 

If you want to take it to the next level implement LRU cache with a time limit. When no read and write operations are performed on LRU for certain time invalidate the cache. Even better invalidate only specific node when there is no operation on that node for a certain time.

I often write and share about technology! You can follow my updates on [LinkedIn](https://www.linkedin.com/in/udayvunnam/) and [Twitter](https://twitter.com/codeasync). Happy coding!

Note: This article was originally published on [Medium](https://medium.com/dsinjs/implementing-lru-cache-in-javascript-94ba6755cda9)