teleren/devto huggingface dataset:
`let` vs `const` and The Mental Mass of Functions
Tags: javascript, const, es6, declarative
Published: 2017-11-01 00:52:43

---
title: "`let` vs `const` and The Mental Mass of Functions"
published: true
description: 
tags: javascript, const, ES6, declarative
cover_image: https://thepracticaldev.s3.amazonaws.com/i/b9nj9ujhp0y2lq24v5cf.jpg
---

###let is the new var?

So this revelation of sorts was presented to me during a code review. "Why did you use `let` here? I don't see it changing anywhere in this function?"

Well you see, I began to explain, nearly every es6 tutorial I've seen declares `let` as the new de-facto `var` (with block scoping). Grab `let` as your go-to variable unless you know for a fact that you don't need to re-assign it - in that case you can use `const`. This seemed like a good approach to me, keeps my variables flexible until I choose to explicitly restrict them.

###const first approach
"No, no, no" he began. "You should reach for `const` by default, and only if you intend for the variable to *change* should you use `let`. As soon as I see a `let` I start to look for where it will be reassigned. If you use `const` I can simply forget about it and have one less thing to think about."

![mind blown](https://prodimage.images-bn.com/pimages/2940014355193_p0_v1_s550x406.jpg)

This made so much sense to me that I'm kinda surprised it's not the default recommendation. This approach also fits right in with the functional/declarative approach to programming that I'm trying to adopt as it clearly states intent and minimizes distractions. It may seem like a minor change, but in more complex functions with multiple arguments and reassignments, this small change can be very helpful in reducing the cognitive load of the function.

Now instead of mindlessly using `let` 'just in case' I may want to re-assign later, I just grab `const` by default and in the event I'd like to re-assign halfway through a function, I'll go back and change it to a `let`. 

Thanks for reading my first post on **dev.to**!
Jekyll Short Url
Published: 2021-11-19 17:25:43

---
title: Jekyll Short Url
published: true
date: 2017-11-01 00:00:00 UTC
tags: 
canonical_url: https://www.weckmann.me/posts/jekyll-short-url/
---

Jekyll Short Url uses Goo.gl as a backend and a small Script on your 404 page.

**PLEASE NOTE THAT GOOGLE HAS SHUT DOWN GOO.GL**

## How To

Place this in your 404 page.

```
<script>if (window.location.href.indexOf("sh") > -1) {var shortCode = document.location.href.substring( document.location.href.lastIndexOf( '/' ) );window.location.href = "https://goo.gl" + shortCode; }</script>
```

To use Jekyll Short Url simply navigate toyourblog.com/sh/shorturl.

**Example:** https://clarkhacks.com/sh/48KCGo

* * *
 

[Reply via email](mailto:arpitbatra123@gmail.com?subject=Reply:%20Jekyll%20Short%20Url)
What about use case driven development?
Tags: discuss
Published: 2017-10-31 21:24:00

---
title: What about use case driven development?
published: true
description: 
tags: discuss
---

For a lot of people, the term *use case* is either completely vague, or associated with *big upfront specification*.

I think Use Case Driven Development can be very valuable, when rightly applied. Even in agile development. What are your experiences & thoughts?

Links for background information:
[EPF definition of Use Case Driven Development] (http://epf.eclipse.org/wikis/openup/practice.tech.use_case_driven_dev.base/guidances/practices/use_case_driven_dev_practice_64D20777.html)
[Use Case 2.0 eBook](https://www.ivarjacobson.com/sites/default/files/field_iji_file/article/use-case_2_0_jan11.pdf)
Running view compilation with a progress bar
Tags: powershellmoments, aspnet, powershell
Published: 2017-10-31 21:04:31

---
title: Running view compilation with a progress bar
published: true
description: 
tags: powershell-moments, asp.net, powershell
---

I ran into a build issue where view compilation failed on CI, but I didn't catch it because views aren't normally precompiled in developer builds.  Here's what I wrote to check things out without having to do it manually:

```powershell
$webdirs = gci -rec -Directory -Exclude "*node_modules*" `
  |? { ((Test-Path "$($_.FullName)\*.csproj") -eq $True) `
       -and ((Test-Path "$($_.FullName)\web.config") -eq $True) }

$webdirs |% {$idx = 0}{$pct = $idx/$projDirs.Length; `
  Write-Progress -Activity "Building Views" `
                 -Status ("{0:P}" -f $pct) `
                 -PercentComplete ($pct*100) `
                 -CurrentOperation "aspnet_compiler -v temp -p $($_.FullName)"; `
  aspnet_compiler -v temp -p $_.FullName; $idx++}

```
Request for feedback: Edward the App
Tags: project, showdev
Published: 2017-10-31 20:11:07

---
title: "Request for feedback: Edward the App"
published: true
description: 
tags: project, showdev
---

Over the past month, I've dedicated several nights and weekends to building a simple app named Edward.

**Edward is a web app designed to help aspiring authors write their first book.**

He looks like this:

![App screenshot](https://thepracticaldev.s3.amazonaws.com/i/mokebsz9izjdoxkkdf1l.png)

If you want a full introduction to why and how I built him, you can [read this blog post.](http://isaaclyman.com/blog/posts/introducing-edward-write-better/) He's definitely just an MVP right now, and I haven't announced him anywhere except my personal blog and dev.to so far. I'm looking for some good feedback before I release him into the wild.

This is my request: [try him out](https://edwardtheapp.herokuapp.com) and tell me if you like him, what features are confusing, or how he could be more helpful to you in writing your first book. He's got a free "demo mode" up and running so you won't need to create an account or share any personal info.

![Demo mode](https://thepracticaldev.s3.amazonaws.com/i/hghqk5plrlnba8k69qs4.png)

Sound off in the comments, even if all you've got is a first impression.

I'd be happy to answer any questions about him.

And I'll gladly return the favor, if you're working on a project of your own (you can reach me [on Twitter](https://twitter.com/isaacandsuch)).

Thanks!
Key Testing Artifact:  The Changes Report
Tags: ruby, testing, github
Published: 2017-10-31 20:07:19

---
title: "Key Testing Artifact:  The Changes Report"
published: true
description: 
tags: #ruby #testing #github
---

Over at my GitHub project, RubyTest, I've added an example <a href="https://github.com/BurdetteLamar/RubyTest/blob/master/examples/changes_report/ChangesReport.md#changes-report">Changes Report</a>.

This is the report that I rely on the most.

Check it out.
ðŸ‘» Do you have any horror stories to share? Spooky bugs, scary data leaks, horrifying code, etc. ðŸŽƒ
Tags: discuss
Published: 2017-10-31 19:00:24

---
title: ðŸ‘» Do you have any horror stories to share? Spooky bugs, scary data leaks, horrifying code, etc. ðŸŽƒ
published: true
description: 
tags: discuss
cover_image: http://halloweenpictures.biz/wp-content/uploads/2017/07/happy-Halloween-wallpaper.jpg
---
On Communist Subway Station Names
Tags: story, rant, subway, romania
Published: 2019-01-20 15:19:14

---
title: On Communist Subway Station Names
published: true
tags: story,rant,subway,romania
canonical_url: https://horia141.com/communist-subway-station-names.html
---

Bucharest, the city where I was born, grew up and currently reside, has a medium scale [subway system](https://en.wikipedia.org/wiki/Bucharest_Metro). One of the stranger things people complain about is the _bad_ station names. Perennial favorites are “Precision”, [“The Flatting Mill”](https://www.youtube.com/watch?v=9n1LAOCHuso), “Peace”, “Heroes”, “The Polytechnic”, “Writers”, “Horizon”, “Modern Times”, “Defenders Of The Country”, “Aviators”, “The Youth”, etc.

![Subway](https://horia141.com/assets/bucharest-subway.png)Image by [Mliu92](https://commons.wikimedia.org/wiki/User:Mliu92), distributed under a [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) license.

However, it’s hard for somebody who isn’t from Romania or from a former [eastern bloc country](https://en.wikipedia.org/wiki/Eastern_Bloc) to grasp just what’s wrong with them. The _badness_ stems from the fact that they’re “communist sounding”. Which basically means that they’re abstract-ish nouns or verbs, usually related to industry, science or the parts of the past the party deemed “glorious”. Most of the times they are written in a very specific way as well, as if they were part of a larger congratulatory sentence. So the proper English translation would be “Precision” not as in “The _precision_ of this device is 2 nanometers”, but rather “Dedicated to the _precision_”. Or “Dedicated to the _heroes/aviators/the youth/writers/etc_”.

![Titan](https://horia141.com/assets/bucharest-subway-titan.jpg)Titan looks very impressive as far as subway stations go. And it’s name isn’t _that_ communist. Image by Mihai Petre, distributed under a [CC BY-SA 3.0](https://creativecommons.org/licenses/by-sa/3.0/) license.

Now, most stations are named after the surrounding area they’re serving, so the criticism should be addressed at the city for having bad names. However, since it’s very hard to change city area or street names, and relatively easy to change subway station names, I think it’s fair to complain about the latter. And it’s [been done before](http://economie.hotnews.ro/stiri-consumator-5899953-opt-statii-metrou-incepand-sambata-nume-noi.htm) to some success. Before 2009, we also had “The Combine Harvester”, “The Army Of The People” and “Industries”. But while the latter two got decent new names, such as [“Petrache Poenaru”](https://en.wikipedia.org/wiki/Petrache_Poenaru) (the inventor of the [Fountain Pen](https://en.wikipedia.org/wiki/Fountain_pen)), and “Lujerului” (a proper name of an area), respectively, “Industries” became “Precision”. To add insult to injury, “Laromet” (again a proper name of a company), became “The Flatting Mill”. Come to think of it, perhaps that’s not the _most efficient_ way.

Anyway, there’s no point to this post. Just a thing I wanted to write. So there you have it.
Create, export and import components in React Native (vs JAVA)
Tags: reactnative, hybridappdevelopment, mobileapps, components
Published: 2023-01-06 17:42:39

---
title: Create, export and import components in React Native (vs JAVA)
published: true
date: 2017-10-31 18:52:34 UTC
tags: reactnative,hybridappdevelopment,mobileapps,components
canonical_url: 
---

 **What is a Component?**

The Components are the building blocks in React Native which is similar to the container where all UI elements do accumulate and help to render details in the foreground as a native UI on either Android or iOS devices.

### **How to create a Component?**

I assume that React Native installed on your machine, If not no worries, Please refer my previous blog post on [Environment setup](https://takeoffandroid.com/react-native-setup-in-mac-for-a-progressive-application-development-e9fb001c62c3).

**Code Implementation:**

<iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/8c8fb26323b494defa886d5e69799e6a/href">https://medium.com/media/8c8fb26323b494defa886d5e69799e6a/href</a></iframe>

Copy-paste the above code snippets into index.js. You’re right to go. Yet confused? Chill! Let’s break the code into pieces in a better way.

```
       **React Native JAVA**


**import** React from 'react'; **import** java.util.*;

**import** { Text, AppRegistry } 
    from 'react-native'; **import** java.text.*;

**const** App = () => ( public **class** App {

); }

**AppRegistry**.registerComponent **package** com.componentdemo
('ComponentDemo', () => App);
```

**const**  — This is similar to a class in JAVA, which lets you declare a component block in React Native.  
**AppRegistry**  — is the kick starter helps to build React Native apps where all parent or root component should be registered using ‘registerComponent’ function.  
**<Text>**  — This is similar to **<TextView>** in Android and **<Label>** in iOS.

### How to export a Component ?

It’s simple. Create **‘src/components/YOUR\_FILE\_NAME.js’** inside your project **root ** folder.

![](https://cdn-images-1.medium.com/max/602/1*u1M9zNOzHkWx4V1OxV6uBg.png)

Create a component ‘ **Title’** and export it as a reusable component.

**For Example:**

```
export default Title; //Provides export access for the component
```

**Code Implementation:**

<iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a435dc30a245a52cdebb8943bdd2fb7d/href">https://medium.com/media/a435dc30a245a52cdebb8943bdd2fb7d/href</a></iframe>
### How to import a Component from different .js file ?

Add the following import statement in the destination Component  **.js ** file.

```
import Title from './src/ **components** /importcomponentdemo';
```

**Complete code:**

<iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/674fcf595ab02822c7ee15f12db9c247/href">https://medium.com/media/674fcf595ab02822c7ee15f12db9c247/href</a></iframe>

**Output:**

> “_Hello Title_”

Yes! You’re done. Now it’s possible to access < **Title** > property from the base file.

* * *
Upgrading C# in your Razor files with PowerShell
Tags: powershell, aspnet, csharp, powershellmoments
Published: 2017-10-31 16:26:01

---
title: Upgrading C# in your Razor files with PowerShell
published: true
description: Upgrading C# in your Razor files with PowerShell
tags: powershell, asp.net, csharp, powershell-moments
---

```powershell
git ls-files | sls web.config ` # get a list of web.config files here, but not with Get-ChildItem
  |% { (gc $_) -replace "/langversion:default","/langversion:latest" ` 
  | sc -Path $_ -Encoding UTF8 }
```
References and sources for modern software project management?
Tags: discuss, management, career, learning
Published: 2017-10-31 14:40:09

---
title: References and sources for modern software project management?
published: true
tags: discuss, management, career, learning
cover_image: https://i.vimeocdn.com/video/448349399_1280x720.jpg
---

Hello everyone. To get my bachelor's degree I need to create the full documentation of a new project, and needless to say I have to make academic references and justify my decisions. Most of this stuff I know from experience or practice, or have outdated sources to reference.

In delivering the best paper I can, and also to grow professionally, I am looking for up-to-date information that can apply to modern software development (especially now that Cloud architecture is everywhere). I will greatly appreciate it if you can help me with the best sources you know, preferably printed material.

The most important topics to justify are:

* Security measures
* Software methodologies (mostly for small groups. I'm thinking agile)
* Feasibility studies
* Requirement gathering
* Data/database architecture (non-relational, noSQL databases)
* Implementation plan
What should be in the software developers 'Hippocratic Oath'?
Tags: discuss, ethics
Published: 2017-10-31 14:27:17

---
title: What should be in the software developers 'Hippocratic Oath'?
published: true
description: 
tags: discuss, ethics,
cover_image: https://thepracticaldev.s3.amazonaws.com/i/fpnlvo22lki2bj4erh84.jpg
---

In my [blogpost from last week](https://dev.to/ardennl/developers-mercenaries-for-hire-63o) I said that if software developers had a Hippocratic Oath most (tech) companies would be out of business. I said that jokingly but when I read this Guardian article: ['Coders of the world, unite: can Silicon Valley workers curb the power of Big Tech?'](https://www.theguardian.com/news/2017/oct/31/coders-of-the-world-unite-can-silicon-valley-workers-curb-the-power-of-big-tech) I was wondering if it holds some value, and what you lot think about this. 
From the article: 
> Martin Manning, a former Silicon Valley labour organiser who served as assistant secretary of labour for Bill Clinton, believes unionising engineers is impossible. “It isn’t to say a group of engineers with concerns about privacy, AI, anything, shouldn’t be getting together and sharing those concerns,” he told me. “But they should think about a professional organisation.” Manning believes that engineers should establish codes of conduct, like doctors or librarians. (There was one such organisation in the 1980s, called Computer Professionals for Social Responsibility.)

Some questions to get you started:
* What would be in the 'developers Hippocatic Oath'?
* Do you think something a 'developers Hippocatic Oath' could actually change something?
* Would a 'developers Hippocatic Oath' be viable and why / why not?
How to Share Simple Bash Tasks with Others by Using Sparrow
Tags: perl, sparrow, bash, linux
Published: 2017-10-31 14:16:54

---
title: How to Share Simple Bash Tasks with Others by Using Sparrow
published: true
description: How to Share Simple Bash Tasks with Others
tags: perl, sparrow, bash, linux
---

[Sparrow](http://sparrowhub.org/) is a Linux scripting platform to ease the daily scripting jobs and distribution. In this small post I am going to show you how to share simple Bash tasks with the rest of the world.


# Install Sparrow

```
$ sudo yum install curl
$ cpanm -q --notest Sparrow 
```


# Create Bash Task

First of all we need Bash plugin:

```
$ sparrow index update
$ sparrow plg install bash
```

Then let's create a task. I always forgot how to install Rvm/Ruby so I want a mnemonic command for this:

```
$ sparrow project create utils
$ sparrow task add utils ruby-rvm-stable bash 
```

```
$ EDITOR=nano && sparrow task ini utils/ruby-rvm-stable
command: "\curl -sSL https://get.rvm.io | bash -s stable --ruby"

```


# Share Bash Task

First of all you need to get an account at [SparrowHub](http://sparrowhub.org/), because you're going to save your task into the account. 

Then having set credentials up:

```
$ cat ~/sparrowhub.json

{
  "user"  : "melezhik",
  "token" : "*****-****-****-*******-*****"
}

```

Just upload the task with some useful description:


```
$ sparrow remote task upload utils/ruby-rvm-stable "Install RVM stable with ruby"
```

By default your tasks are private so it is only you who can see them. Let's take simple step to changes this:


```
$ sparrow remote task share utils/ruby-rvm-stable
```


# Running Remote Bash Task

Now the rest of the team could enjoy your little nifty task. To do this they only need Sparrow client installed:


```
$ sparrow remote task run melezhik@utils/ruby-rvm-stable
``` 

# Community Remote Tasks 

To list SparrowHub community remotes task just say this:

```
$ sparrow remote task public list
```

Further reading is Sparrow [documentation](https://github.com/melezhik/sparrow#remote-tasks) on remotes tasks.


# Conclusion

Sparrow enables creation of scripts in easy and fun manner. Or if you want - "Quick and dirty way to develop some useful script and share with others".
npm install private-package
Tags: npm, repo, repository, javascript
Published: 2017-10-31 13:50:10

---
title: npm install private-package
published: true
description: Host private packages seamlessy
tags: npm,repo,repository,javascript
---

Not everyone can commit code publicly to [GitHub](https://github.com) and publish packages to [npmjs.com](https://www.npmjs.com/). We all benefit from those who do, no doubt. But many of us apply those generous offerings to (and write fresh code for) internal, private projects.

However, that is no excuse to develop large, monolithic internal projects. I declare: modularization and implementation of independent packages is still necessary! Keep projects narrowly-focused. Write independent, useful, reusable packages!

> _uh, okay idealogical goofball. HTF am I supposed to conveniently make use of private packages when I can't just `npm install my-super-secret-pkg`?_
> ^ Nay-sayer

Ah, but you can! Read on...

[Sonatype](https://www.sonatype.com/) has a product called [Nexus](https://www.sonatype.com/nexus-repository-oss). It's a well-known Maven (Java) repository you can run privately. But get this: it's not just a private Maven repository ðŸ˜® It's also a private PyPi repository, and ... wait for it ... a private npm repository ðŸŽ‰ðŸ‘ And it's free!

Details about configuring Nexus for npm repositories can be found [here](https://help.sonatype.com/display/NXRM3/Node+Packaged+Modules+and+npm+Registries). Note that you can easily set it up to proxy npmjs.com _and_ host your private packages at the same time â¤ï¸

This has been crucial in recent projects for me. An electron application we've been developing included lots of complex, independent algorithms that deserved their own projects to house documentation and tests. Rather than bloat the electron project with in-the-weeds details, I was able to put those weeds in their own npm packages and have already begun reusing them in other applications.

If your situation enables it, please keep posting your magic to npmjs.com. We all benefit! But if you can't, running a private repo is a must!
Improving the display image of MacBook Air
Tags: macbookair, apple
Published: 2017-10-31 10:57:09

---
title: Improving the display image of MacBook Air
published: true
description: Improving the display image of MacBook Air
tags: MacBook Air, Apple 
---

Since 2011, Apple has been using screen panels from Samsung and LG in 
the MacBook Air. Both displays are very high quality, but, it seems, how LG panels work worse with Apple’s standard color profile. This makes the picture a little flat and pale.

Disclaimer: I personally recommend buying one on [Amazon - MBA](https://www.amazon.co.uk/gp/product/B072N2FRY9/ref=as_li_tl?ie=UTF8&camp=1634&creative=6738&creativeASIN=B072N2FRY9&linkCode=as2&tag=websell-21&linkId=767211c6b2df6b56f1dc378db9938b4a)

To fix the situation, it is enough to replace the standard color profile with a modified one for the MacBook Air. In practice, it turned out that it will improve the picture not only of the LG matrices, but also of Samsung. In any case, it happened with me with MBA 13“(2013).
We check the matrix manufacturer

To find out the manufacturer of your display, start the Terminal (/ Programs / Utilities /) and run the following command:
$ ioreg -lw0 | grep IODisplayEDID | sed “/ [^ & lt ; ] *

At the output you will get something like LTH116AT01A04 . It stands for this simple matter:
- LP — LG
- Everything Else — Samsung

If interested, then you can drive this code into Google and recheck the manufacturer. But, again, judging by the reviews, the new color profile helps not only matrices from LG, but also from Samsung.
Change the color profile

I tried several color profiles for MBA and most of all I liked MacRumors version . If you are interested, then in that branch of the forum you can find other options. So:
Download and unzip the archive with the profile — Custom Profile
Open the Finder and press Cmd Shift G

In the window that appears, enter 
/ Library / ColorSync / Profiles / Displays /

The Displays folder is displayed in your Finder. Copy the CustomMBA.icc profile into it.
Now go to System Settings → Monitors → Color and uncheck the Profiles of this monitor only . Our new profile will be called For MacBook Air .

Once you select it, you will immediately notice the difference. To return everything back, just choose the standard version from Apple.
As I said above, my matrix LTH116AT01A04 (Samsung) also began to behave better. 
The image turned out slightly darker and sharper. 
Try and let’s discuss the results :)

I personally recommend buying one on [Amazon - MBA](https://www.amazon.co.uk/gp/product/B072N2FRY9/ref=as_li_tl?ie=UTF8&camp=1634&creative=6738&creativeASIN=B072N2FRY9&linkCode=as2&tag=websell-21&linkId=767211c6b2df6b56f1dc378db9938b4a)