teleren/devto huggingface dataset:
Building and Securing MobX Apps with Auth0
Tags: security, xss, developer
Published: 2020-01-21 19:48:02

---
title: Building and Securing MobX Apps with Auth0
published: true
description: Learn how to build React apps with MobX and secure them with Auth0.
tags: #security #xss #developer 
canonical_url: https://auth0.com/blog/building-and-securing-mobx-apps-with-auth0/
---
TL;DR: MobX is one of the popular state management libraries out there. It is frequently used with JavaScript frameworks such as React and VueJs. Auth0, on the other hand, is an identity management solution for both web and mobile apps. In this article, you will learn how to build and secure MobX apps with Auth0. The fully functional app can be found on this GitHub Repository.

Prerequisites
You are expected to have prior knowledge of building web apps with React and state management with MobX. If you still need to learn a thing or two about that, here is a good resource to get you started. Asides that, you need Node.js and NPM installed on your machine. If you don't have that, follow the links to set it up on your machine.
 [Get started!]( https://auth0.com/blog/building-and-securing-mobx-apps-with-auth0/?utm_source=twitter&utm_medium=sc&utm_campaign=mobx_auth0)
Why didn't Microsoft use React or Angular to build Visual Studio Code?
Tags: react, javascript, webdev
Published: 2020-01-21 19:37:38

---
title: Why didn't Microsoft use React or Angular to build Visual Studio Code?
published: true
description: A short answer to a legit question.
tags: react, javascript, web development
---

A text editor like Visual Studio Code is a complex and performance-critical application. In this case, is better to start from scratch and use pure JavaScript instead of a framework. A clear example of this is that in 2014 the Atom text editor was [rewritten in React](https://blog.atom.io/2014/07/02/moving-atom-to-react.html) and in 2015 it was [rewritten again](https://github.com/atom/atom/pull/5624) into pure JavaScript because of performance concerns.

I found this question poorly answered on this [Quora](https://www.quora.com/Why-didnt-Microsoft-use-Angular-or-React-to-build-Visual-Studio-Code) thread and it is my motivation for writing this short article.

If you have any questions, feel free to ask me in the comments.

References:
- Moving Atom To React: https://blog.atom.io/2014/07/02/moving-atom-to-react.html
- Implement text editor DOM updates manually instead of via React: https://github.com/atom/atom/pull/5624

Curious about relevant software development topics?

Follow me here on the Dev community,
and on Twitter: https://twitter.com/carloslfu

Have a good day :)
What does the M in JAMstack actually mean?
Tags: jamstack, jamuary
Published: 2020-01-21 19:17:08

The M in JAMstack is the root of much confusion. Though it officially stands for Markup i.e. HTML, many assume the M to mean Markdown. Given that it is common practice to use a Static Site Generator(SSG) with the JAMstack, and that SSGs render HTML from Markdown, it’s unsurprising that the acronym is thus misconstrued. Compared to Markdown, Markup is far more expansive and encompasses templating languages (e.g. Markdown) and data serialization languages (e.g. YML and JSON) alike. Specifically, markup in the JAMstack terminology refers to “pre-rendered” markup or content served in its final form, HTML. The distinction here is the delivery mechanism of content. Within the JAMstack model, content is not delivered dynamically via a web server tasked with building pages at runtime. Rather, markup is prebuilt upfront and served to the browser via a CDN. The power of serving content this way rests in build tools and processes like Gulp, Grunt and now Webpack and Babel. These tools not only combine content with templates, they enable sites to take advantage of modern advances in JavaScript and CSS way before browsers even ship them. The strength of compiling at build time also means that calls to external APIs and services can be made ahead of time. Oftentimes, APIs add bloat to a site especially when executed at runtime. Running APIs at the build stage means teasing apart the underlying infrastructure from the live site so neither site performance nor uptime suffers when an external API b0rks unexpectedly. This also means that individual APIs can be considered in isolation and further highlights the decoupled architecture that the JAMstack pushes for. 

The ambiguity of the acronym aside, the M in JAMstack emphasizes how content is delivered, instead of what format that content was in prior to pre-rendering. Content on the JAMstack can effectively come from anywhere, but as long as it’s pre-rendered it counts as “M”. 

If you’d like to dig into the M in JAMstack, there’s a fantastically written post by [Brian Rinaldi](https://dev.to/remotesynth) that might be of interest. Check it out over on his blog: https://remotesynthesis.com/blog/m-is-for-markup

And to start digging into building the Js, As and Ms in JAMstack, https://templates.netlify.com/ is a great starting point.
How make a Sitecore solution GDPR compliant
Tags: sitecore, csharp, dotnet
Published: 2020-01-21 19:10:52

With the first fine being granted to a company since the introduction of the new European GDPR laws, it is time for our own Sitecore solutions to be adapted. Those GDPR laws restrict the tracking of users without the user’s consent, which is mostly done by setting certain cookies. This means that those cookies cannot be set without consent of the user. 
In Sitecore, users are tracked by Sitecore Analytics which creates a contact profile containing the information gathered of the user. In order to track users, Sitecore Analytics uses the __SC_ANALYTICS_GLOBAL_COOKIE__ cookie.

#Disabling the tracker & cookie
So, in order to make your Sitecore solution GDPR compliant, well, the tracker should not be started, and the analytics cookie should not be set (and removed if it was already set). This can be done easily because for every request without a tracker, the _startAnalytics_ pipeline is started. This pipeline, as the name suggest, starts a whole bunch of things for Sitecore Analytics. If you would analyze the pipeline you would see that there is a processor called _CreateTracker_. The processor creates the tracker and when creating a tracker the cookie is set, therefor this is where the pipeline should be aborted when the user did not give his or her consent. This can be easily done by inserting a new processor right before the _CreateTracker_ processor:

```xml
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
  <sitecore>
    <pipelines>
      <startAnalytics>
        <processor
          type="YOURPROCESSOR" patch:before="processor[@type='Sitecore.Analytics.Pipelines.StartAnalytics.CreateTracker, Sitecore.Analytics']" resolve="true"/>
      </startAnalytics>
    </pipelines>
  </sitecore>
</configuration>
```
That processor should abort the pipeline when the user did not give any consent and the Analytics cookie should be removed if it was already be set:

```c#
if (SC_ANALYTICS_GLOBAL_COOKIE not allowed)
            {
                if (HttpContext.Current.Request.Cookies["SC_ANALYTICS_GLOBAL_COOKIE"] != null)
                {
                    var myCookie = new HttpCookie("SC_ANALYTICS_GLOBAL_COOKIE");
                    myCookie.Expires = DateTime.Now.AddDays(-1d);
                    HttpContext.Current.Response.Cookies.Add(myCookie);
                }

                args.AbortPipeline();
            }
```

#Aftermath
Because the user is not tracked and the tracker did not start, __a lot of things will not work anymore__: personalization, device detection, all code using the user profile (via XConnect),… So be aware of this and make sure that your Sitecore solution does not crash and can handle this, especially the abscent XConnect. As it will throw errors telling you that the tracker is not initialized (Tacker.Current is not initialized).
Also on a small side note, this code does block the analytics cookie but __to make your site fully GDPR compliant you might need to block other cookies as well__ (either 3rth party or your own custom ones).
The DEV <> Stackbit integration is in the running for a Product Hunt "Golden Kitty Award"
Tags: meta, projectbenatar
Published: 2020-01-21 19:03:00

This is a chance to remind everybody of this functionality which allows folks to use DEV as a headless CMS for personal websites...

{% link https://dev.to/devteam/you-can-now-generate-self-hostable-static-blogs-right-from-your-dev-content-via-stackbit-7a5 %}

It's a nice, seemless integration that we love to support and plan to keep building on top of as we move forward in our attempts to enable content distribution and data portability.

People seem to like it, as it's been nominated on Product Hunt.


# **[👉 Vote Here](https://www.producthunt.com/golden-kitty-awards-2019/voting/dev-tool/)**

Happy coding!
My Understanding of Event Loop in Nodejs
Published: 2020-01-21 19:00:16

Normally, Nodejs is an application which use single thread, but through the concept of events and callbacks It can support the concurrency. Every single API use a one thread and control the timing of operations by the use of pulse sent when the previous operations is completed, which means that two operations can not run simultaneously. To maintain the concurrency API use a sync function calls. Node thread keeps events loop and whenever an operation is completed, it send the equivalent event which trigger the execution of events listener function. the function that listen to events act as observers.

Even thought, callbacks look like events, they are different. the event handling works on the observer pattern but callback functions are called when an asynchronous function returns the result.
  Whenever an event gets fired, its listener function starts executing. Node.js has multiple in-built events available through events module and EventEmitter class which are used to bind events and event-listeners.

Nodejs is also called event driven programming due to its heavily use of events which This makes it faster than other technologies. immediately after node starts its server; it just initiate its variables, declare functions, then waits for the events to occur. any async function accepts a callback as the last parameter and a callback function accepts an error as the first parameter.  

Despite the fact that JavaScript is single-threaded,The event loop is what allows Node js to perform I/O operations without being blocked by offloading operations to the system kernel whenever possible.
 
When Node js starts, it initializes the event loop, processes the provided input script which may make async API calls, schedule timers, then begins processing the event loop.
Generally, when the event loop enters a given phase, it will perform any operations specific to that phase, then execute callbacks in that phase's queue until the queue has been exhausted or the maximum number of callbacks has executed.
Each phase has a FIFO queue of callbacks to execute. While each phase is special in its own way,  When the queue has been exhausted or the callback limit is reached, the event loop will move to the next phase, and so on.
Ionic mobile app builder - Creator by Ionic
Tags: ionic, mobile, app, builder
Published: 2020-01-21 18:56:08

# What is a mobile app builder?
An app builder is an online mobile development tool that lets the user bypass the generic mobile app development process and gets the mobile app developed in a short period of time. The interesting part is that it cuts down the time duration of the app development to a whole new level. Normally, a mobile app development process takes weeks. From ideation to wireframing, interface designing to user-experience analysis, testing to finalizing, it involves a hefty process behind a simple mobile app.
# Creator by Ionic
 [Creator](https://ionicframework.com/creator) is a simple drag-&-drop tool for going from idea to App Store, with just the drag of a mouse.

### How to Get Started with Ionic Creator
It’s really easy to start using the Ionic Creator, the first step is to create an account [here](https://creator.ionic.io/app/signup) and then log in. 
![ionic_dashboard](https://www.mobileframeworks.dev/content/images/2020/01/ionic_dashboard.png)

#### The best thing about using Creator by Ionic is that it is FREE and they have a nice structured [documentation](https://docs.usecreator.com/docs).

#### [Check article here](www.mobileframeworks.dev/ionic-mobile-app-builder/?ref=devto)
Print (media) ISNT dead
Tags: print, media
Published: 2020-01-21 18:46:54

Just picked a copy of @ComputerActive and @WebUser in my local Sainsburys supermarket 

Only 70 pages each (instead of 300 in the good old days) BUT great value at less than the price of a pint @ £2.50

See
* https://dev.to/osde8info/uk-gov-to-de-criminalise-watching-tv-tayt-wins-5ega
* https://dev.to/osde8info/edge-to-switch-to-chrome-engine-3dl7

AND a whole new format has appeared in the UK - the bookazine

The Complete Coding Manual (pictured above) isnt a book (its priced as a book @£12) and it is isnt a magazine (is has a semi hard cover)
UK GOV to de-criminalise watching TV - TAYT wins !
Tags: politics, tech, streaming
Published: 2020-01-21 18:42:52

According to the computer magazine @ComputerActive the UK GOV is set to de-criminalise watching TV in the UK this year 

Throw Away Your Tv (TAYT) have been campaigning for this for many years - the personal use any specific tech should NEVER be criminal only the USE of a specific tech to cause damage to someone else

NOTE TO TOURISTS TO UK there is constitution here and so it is currently STILL illegal to watch any live TV channel on your mobile in the UK you are liable for a £1000 fine or imprisonment 

BTW this is the first ever (YAY!) devto post to mention TAYT 
https://dev.to/search?q=tayt
Patching Searchkich Gem To Add Custom Queries By Default
Tags: rails, ruby, searchkick, monkeypatching
Published: 2020-01-21 18:42:31

# Context
So a bit of context, as I'm working on Triplancer.net which is a Multi-Tenant Project developed by Ionite I needed to scope results returning for any Searchkick Query by the Current Tenant Id not to return results from other tenants.

You can do that simply by using a where query something like:

```
where: { tenant_id: current_tenant_id }
```

I did not want, however, to have to write this on every query I write, I wanted a way to override search method for models that are tenant-scoped, and add that tiny query by default to whatever Searchkick queries are made on that model.

Luckily, overriding stuff is fairly easy in Ruby, I just needed to look for where exactly should I inject my code.

# SearchKick search() method
Looking at the Searchkick codebase for the source code of the method ``searchkick`` - that used to initialize searching inside a model - here: https://github.com/ankane/searchkick/blob/master/lib/searchkick/model.rb

You can find that, on line 43, Searchkick inserts a method called ``searchkick_search`` to the model eigenclass and conveniently to us alias this method with `` Searchkick.search_method_name `` which you can change but is set by default to ``search`` here: https://github.com/ankane/searchkick/blob/d10ffd4fd97003b638cb93821dcab3c86a2abba5/lib/searchkick.rb#L42

That makes our job very easy, all we need to do is follow the same convention and define a method, let's call it ``scope_searchkick``, that has the same signature and currys the searchkick_search method with the scoping query.

``` ruby
  def self.scope_searchkick
    class_eval do
      class << self
        def search(term = '*', **options, &block)
          options[:where] = {} unless options.key?(:where)
          options_with_tenant_scope = options[:where].merge(
            { tenant_id: current_tenant_id }
          )

          searchkick_search(term, options_with_tenant_scope, &block)
        end
      end
    end
  end
```

Now, all we need to do is call this method after the ``searchkick`` method in our models.

I've defined this method in the ApplicationRecord class so that it'd be available in every model to call but you can define it anywhere you see suitable.

One last edit: Let's make it defensive and define it in a way that if we change ``Searchkick.search_method_name`` our patch would still work.

How to do that?, we can simply use ``define_method`` instead of ``def`` and pass the ``Searchkick.search_method_name`` now our ``scope_searchkick`` method is:

``` ruby
  def self.scope_searchkick
    class_eval do
      class << self
        define_method Searchkick.search_method_name do |term= '*', **options, &block|
          options[:where] = {} unless options.key?(:where)
          options_with_tenant_scope = options[:where].merge(
            { tenant_id: current_tenant_id }
          )

          searchkick_search(term, options_with_tenant_scope, &block)
        end
      end
    end
  end
```

You've got to love the Ruby Metaprogramming.
Finding a University in Japan for researching Privacy Enhancing Technologies.
Tags: academia, research, privacy
Published: 2020-01-21 18:18:42

Guys, beyond loving to code my own projects 48/9 (because in professional software engineering, there are some limitations such as time and job estimations) I also love in Japan and keeping your personal-data-chan safe ;)

So I plan to continue my [master thesis](https://www.researchgate.net/publication/331837733_Himitsu_Project_The_Beginning_Initial_Architecture_and_Multiparty_Support) into a PhD in Japan (Akiba babe!!!). But I have a big hardship. How to locate a university that actually does research on privacy and hopefully to release my fruits of my research as Libre Open and Free software ('cause we all love freedom in speech and in beers[or chocholate milk i hate beer]).

So I would love if you can suggest me some Universities that Actually do research on privacy and Privacy enhancing technologies. can you do please (does puppy eyes)?
Welcoming Three New Team Members 🎉
Tags: meta
Published: 2020-01-21 18:11:54

---
title: Welcoming Three New Team Members 🎉
published: true
description:
tags: meta
cover_image: https://thepracticaldev.s3.amazonaws.com/i/97a2sge9bgapcn6szuep.png
---

We are so thrilled to welcome Vaidehi, Nick, and Josh to the DEV Team. 

We've been big fans of Vaidehi since we first discovered BaseCS, her series of blog posts that break down complicated computer science concepts. She is an incredible educator, writer, and developer. We were so impressed by BaseCS that we ended up producing an entire BaseCS video series with Vaidehi right on DEV. We then went on to create another video series together, called [ByteSized](https://dev.to/bytesized), which is all about coding history. 

Needless to say, we've been collaborating with Vaidehi for many years and we are so excited that she's officially part of the team as a Senior Software Engineer. You can read more about Vaidehi here:

{% link https://dev.to/vaidehijoshi/hello-dev-3jm9 %}

If you check out our contributors page on the dev.to repo, you'll see a bunch of DEV staff members at the top of the list...which makes a lot of sense! Immediately listed after DEV staff? Nick Taylor. Yep, Nick has been one of our top contributors for quite some time. In fact, we used to joke that Nick was our main frontend dev. Now he really is! We're so excited to welcome Nick as a Software Engineering Core Contractor. You can learn more about Nick here:

{% link https://dev.to/nickytonline/a-new-year-a-new-start-i-m-joining-the-dev-team-3ap0 %}

Want to know something awesome about Josh? He's been a DEV member since January 2017, making him the longest-registered member of this group of new hires! We love that Josh has been lurking around since the early days and are so excited that he'll play a role in how we evolve. Josh has already brought great energy to the team, and we can't wait to see what he contributes as a Principal Software Engineer. You can learn more about Josh here:

{% link https://dev.to/joshpuetz/i-m-joining-the-team-at-dev-2dlp %}

Everyone, please give Vaidehi, Nick and Josh a warm welcome!

![happy-minions](https://media.giphy.com/media/11sBLVxNs7v6WA/giphy.gif)
A New Year, a New Start: I'm Joining the DEV Team!
Tags: career
Published: 2020-01-21 18:09:58

I can't believe I'm saying this. I'M JOINING THE DEV TEAM!!!

![Thor Ragnarok: Thor in the gladiator ring seeing Hulk and gets excited](https://media.giphy.com/media/l4FGni1RBAR2OWsGk/giphy.gif)

For those of you that don't know me, my name is Nick Taylor, a senior software developer from Montreal, Quebec, Canada. 👋 You can find out all about me on my site, [iamdeveloper.com](https://iamdeveloper.com) which I cross-post to DEV.

Aside from DEV, you can also find me on [GitHub](https://github.com/nickytonline), [Twitter](https://Twitter.com/nickytonline) and [Instagram](https://instagram.com/nickytonline) as @nickytonline. I also run the Twitter handle [@vscodetips](https://twitter.com/vscodetips).

Over the years I have worked in many different kinds of places. From a social media platform, to e-commerce, fintech, security, AI startup land, and most recently the film/VFX industry.

The majority of my career has been in the .NET ecosystem in some full-stackish capacity, but I have always loved JavaScript, so I made a conscious decision to switch to the frontend back in 2016. You can read a bit about that in one of my rare career advice posts.

{%link https://dev.to/nickytonline/take-chances-and-standout-because-who-knows-3kh6 %}

I love this community and have been a code contributor and content creator on the platform for quite some time now. I also moderate a couple of tags.

![Hackerman from Kung Fry typing on a keyboard with a Nintendo Power Glove](https://media.giphy.com/media/VHHxxFAeLaYzS/giphy.gif)

One of the many things I love about DEV is that the [team interacts with the community](https://dev.to/ben/comment/493). I give you exhibit A.

Some fun facts about me:

* I was the first person outside of the core team to contribute to the DEV repository.

{%link https://dev.to/jess/dev-monthly-report--march-2018-579p %}

* I'm not a big fan of spiders. 🕷
* I dyed my hair pretty frequently in university

{%instagram B0WJGwsJrCb %}

* I played rugby for many years

{%instagram B0Cm4-7pr4T %}

* I've gone as Wolverine for Hallowe'en one too many times. 😆

{%instagram B3a1szWJdDs %}

* I used to play in a handbell choir (yes that's a thing)

{%instagram B1K7z-fpEP- %}

In my role at DEV, I'll be focusing primarily on the frontend (although I wouldn’t mind getting my feet wet in some ruby), building out new features, improving the codebase and interacting with and learning from all the lovely humans on this platform.

That's all folks! Super stoked!

![Weird plant person firing rainbows out of their arms](https://media.giphy.com/media/3oz8xRF0v9WMAUVLNK/giphy.gif)

P.S. I made this very expensive short film to accompany my announcement that I'm joining DEV. If you’re viewing this on mobile, it’s best viewed full-screen in landscape mode. And the Oscar goes to...

{%youtube dpMJBABCIiM %}