teleren/devto huggingface dataset:
Shutdown Spring Boot command-line application
Tags: spring, commandline
Published: 2019-03-25 02:49:05

---
title: Shutdown Spring Boot command-line application
published: true
description: 
tags: spring,command-line
---

If you have a SpringBootApplication which implements the CommandLineRunner interface and wish to terminate it after running the override run method, here is it:


``` 
@SpringBootApplication
public class DemoApplication implements CommandLineRunner {

  SpringApplication app = new SpringApplicationBuilder()
				.sources(DemoApplication.class)
				.web(false).build();

  springApplication.run(args).close();

  @Overrride
  public void run(String... strings) throws Exception {
    // Code
  }

} 
```
My first gatsby site
Tags: gatsby, react, javascript
Published: 2019-03-25 01:45:11

---
title: My first gatsby site
published: true
description: A brief walkthrough to gatsby js beginner's experience 
tags: gatsby, react, js, javascript
---

### Introduction
I have been coding inconsistently for the past eight months and working on other none coding activities, I currently built my first gatsby site apart from being my first gatsby site it is also the first site I have built using a javascript framework. I prefer working on backend projects but working on my first gatsby site has been interesting.

I built this simple site using gatsby and semantic-ui. It took me two days I had to level up especially on React as it had been a while since I have used it.

## Gatsby documentation
The gatsby documentation is extremely easy and user-friendly and I would advise anyone who would wish to create a gatsby site to consider using the documentation as some of the docs are accompanied by videos for those who prefer using videos.

### Gatsby Development
For me, it was not as smooth as I thought it would since the guys who had used it seemed to find it easy to use and most of them completed the projects in two to three hours for me it took two days.
But building the blog was extremely easy since it used the markdown concept that simplified everything especially for a newbie like myself.
Creation of links and new pages was also very easy credits to the gatsby team.
The fact that it uses React and es6 is also an added advantage.

### Personal thoughts
For me, I would definitely use gatsby again due to the ease and simplicity of building these sites.
Right now I am working on my skills on graphql as I came to understand one of the pillars of gatsby is that it uses graphql and understanding it would be a big plus for me and anyone who would love to learn and use gatsby.

### Biggest Challenge 
My biggest challenge was deploying my app to github pages, the build was passing but my gh-pages link was returning a blank page with only the read-me info, I deployed it on netlify as it was easier.
Visual Studio Tips - View Uncaptured Exception
Tags: vstips, csharp
Published: 2019-03-31 00:10:34

---
title: Visual Studio Tips - View Uncaptured Exception
published: true
tags: VSTips, csharp
canonical_url: https://hutchcodes.net/2019/03/visual-studio-tips-view-uncaptured-exception/
---

Ever have code where you catch an exception because to handle it, but you don’t need to use the exception itself? Maybe just knowing the exception type is enough for you. But then you sometimes want to see it while debugging?

Previously I would just capture the exception and just live with the warning about an unused variable, but now I do this.

<!--more-->

First, what do I mean when I say caught but not captured? In the code below I have caught the `InvalidOperationException` thrown by trying to get the first item from an empty collection. But I haven’t captured the exception in a variable.

~~~ csharp
var foo = new List<string>();

string bar;
try
{
    bar = foo.First();
}
catch (InvalidOperationException)
{
    //Do something like logging or retry
    bar = null;
}
~~~

Without having to change the code at all we can view the exception by viewing the contents of the `$exception` pseudovariable which holds the value of the most recent exception. You can either get the value by adding it to your watch list or by evaluating it in the immediate window.

![alt text](https://hutchcodes.net/img/2019/UncapturedExceptionWatch.jpg "Watch window showing the value of $exception")
Day 5 Learning Javascript
Tags: beginners
Published: 2019-03-24 23:53:23

---
title: Day 5 Learning Javascript
published: true
description: A beginner's journey into Javascript
tags: #beginner
---

Function, Function...what's your Function?

So I finally delved into functions, one of the core components of Javascript. I feel like I accomplished something, as I know how important functions are to using Javascript. And it feels great!

It's a little confusing a first, but after playing around with it more I had a better understanding, that functions are basically actions. And the *()* just "calls" the functions to actually execute. Pretty cool stuff. I can definitely see how useful all this will be once I get deeper into it.

But I can also see how easy it is to wreck your whole code by misplacing a semi-colon. Fun times with functions!
git is hard, but time travel in git is easy.
Tags: git, github, debugging, opensource
Published: 2019-03-24 23:41:22

---
title: git is hard, but time travel in git is easy.
published: true
description: This article explains how it's possible to commit code that is dated in the future. 
tags: git, github, debugging, open-source
canonical_url: https://www.aboutmonica.com/blog/git-time-travel
---

![monica dancing - in space?](https://thepracticaldev.s3.amazonaws.com/i/xbkk2o5mlhplzg5aesz8.png)

This article will explain how it's possible to commit code that is dated in the future. 


![Committing changes in the future](https://thepracticaldev.s3.amazonaws.com/i/9efqn8d43q4cv95uh1du.png)



I always (wrongly) assumed that GitHub determined the time a commit was made based on their website's server time. I made this assumption because for certain user actions GitHub uses their server time, for example when a pull request is opened. However, one day I was debugging a calendar issue that only appeared for certain dates. I was able to reproduce and resolve the bug locally by changing my computer time. I then pushed the git branch with my solution up to the remote git repository on GitHub for code review and realized that GitHub commits reflect the date set in the local version of the git repository which is determined by your computer's system time and not their servers.

GitHub, GitLab and BitBucket are git repository hosting services, that provide a centralized place to host remote versions of git repositories. These websites have additional functionality build on top of git to make the software development process more collaborative through things such as code review interfaces and other features that make it more of a social network than just a command line interface. 

If you want to intentionally for whatever reason commit something in the future, do you have to manually adjust your computer's time? No, you can simply pass git environment variables to set the date and time.

The following line: 
```GIT_AUTHOR_DATE="Wed Mar 27 15:12:30 2019 -0700” GIT_COMMITTER_DATE="Wed Mar 27 15:12:30 2019 -0700” git commit -m “future commit”``` will date a commit as March 27, 2019 whether the current date is before or after March 27th. If you send in a patch to a project and one of the core members applies the patch, both of you get credit — you as the GIT_AUTHOR, and the core maintainer as the GIT_COMMITTER. 

You can [rewrite your git history](https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History) and apply changes to any past commit as well.

This post is based off of a lightning talk that I gave with Women Who Code NYC in March 2019. The slides can be viewed [here](http://aboutmonica.com/gitlightningtalk.pdf).
Emulating Xmonad in JavaScript - Part 3
Tags: xmonad, javascript, developerexperience
Published: 2019-03-24 23:03:10

---
title: Emulating Xmonad in JavaScript - Part 3
published: true
description: More terminal management obsession
tags: xmonad, javascript, developer experience
---

![a GIF showing bash and terminal focussing](https://thepracticaldev.s3.amazonaws.com/i/q7le3y6cla34c17v2cjk.gif)


![a GIF showing terminal swapping](https://thepracticaldev.s3.amazonaws.com/i/snad0iko97ci7okjecdx.gif)

![a GIF showing less working quite well in shmonad](https://thepracticaldev.s3.amazonaws.com/i/nh5dbnkujvx0p86u6kzx.gif)

Look! I made more progress!

This week has mostly been bug-fixing and reverse-engineering the functionality of certain control sequences.

One method I've found very useful is opening `Terminal.app` and running

```sh 
 $ printf '\e#8'   # fill the terminal screen with "E" (no really)
 $ printf '\e[XXX'
```

to see what happens!

I'm slowly starting to realise (a) how complicated terminals are, (b) how tricky ANSI control sequences are as an API and (c) that I'm trying to write an ASNI-compliant terminal in Node.js...

This week's post is a short one, and I'll make sure to post another one ASAP.

# Fin

Please feel free to leave a comment and share your thoughts and if you're keen for more posts like this, follow me! :)

See you next time folks, thanks for reading.
Finding Freelance Web Design/Development Work
Tags: freelance, freelancer, help
Published: 2019-03-24 19:11:27

---
title: Finding Freelance Web Design/Development Work
published: true
description: Freelance web design/development work
tags: #freelance, #freelancer, #help
---

Over the past couple of years, I've had a handful of opportunities to take on work outside of my day-to-day job. In my case, it's been inconsistent as I'd like to do more. I've tried reaching out to local businesses that could use a website redesign and have asked questions like:

<ul>
<li>What do you like about your current site?</li>
<li>What would you do differently with your current site?</li>
<li>How is your relationship with your current developer?</li>
<li>How are you handling changes?</li>
<li>Would you like to make more changes yourself or send them directly to the developer?</li>
</ul>

Many times, the business hasn't responded and I feel like the best approach isn't asking them directly in person since the individual isn't likely present or isn't even a part of on-site operations.

What's some verbiage you've used that you've found to be successful? Are there any tips you can share in your approach to garnering work? I've got work to show for, but feel it hasn't helped progress the freelancer aspect.

I'm not sure if this is the place for this, but If you're looking to collaborate or have a position on your team, I'd be stoked to learn more. Check out some of my work on my portfolio website linked below.

I'd love to hear your thoughts and recommendations moving forward.

Thanks!
DOM Cheat Sheet for JavaScript Programming
Tags: javascript, latestposts, documentobjectmode, dom
Published: 2019-12-26 18:19:29

---
title: DOM Cheat Sheet for JavaScript Programming
published: true
date: 2019-03-24 22:52:06 UTC
tags: JavaScript,Latest Posts,document object mode,DOM
canonical_url: http://robdoylecreative.com/dom-cheat-sheet-for-javascript-programming/
---

This last week I have been learning about accessing and manipulating the DOM using JavaScript. In order to help in processing the many commands there are, I decided to put together a DOM cheat sheet of all the basic commands I am most likely to use on a regular basis and I can refer back […]

The post [DOM Cheat Sheet for JavaScript Programming](http://robdoylecreative.com/dom-cheat-sheet-for-javascript-programming/) appeared first on [Rob Doyle Creative](http://robdoylecreative.com).
For the writing streak badges, do weeks start on Sunday or Mondays?
Tags: meta, questions
Published: 2019-03-24 22:31:01

---
title: For the writing streak badges, do weeks start on Sunday or Mondays?
published: true
tags: meta, questions
---

For the writing streak badges, do weeks start on Sundays or Mondays? In other words, are Monday, March 18th and Sunday, March 24th considered part of the same week?
Learning React, GraphQL, and Apollo?
Tags: javascript, beginners, webdev, discuss
Published: 2019-03-24 20:39:54

---
title: Learning React, GraphQL, and Apollo?
published: true
description: How to build a URL shortener with React, GraphQL and Apollo 
tags: javascript, beginners, webdev, discuss
---

Last year I wrote a five-part series of posts on [another blogging platform](https://medium.com/@pjausovec) and explained how to create a simple URL shortener (e.g. bit.ly) using React, GraphQL, and Apollo. 

I haven't updated the code in a while, so I figured I should go through it and update it with the latest tools etc. I've decided to put it up on LeanPub as an ebook in case anyone is interested. Using [this link](http://leanpub.com/react-url-shortener/c/wDUmKAZrO5fL) you can get a **free version** - if you decide to pay for it, that's fine as well (feel free to DM me on [Twitter](https://twitter.com/pjausovec) if the free version is not available anymore and I'll gladly send you the link). 

I'd love to hear your feedback on it - at the time I wrote that I was learning about React and GraphQL and figured that writing it down might help others. Writing stuff down also helps me learn faster, and as an added bonus, I get the material I can refer back to :) 

I am planning to add another chapter that talks about deployment. If anyone has any suggestions, ideas or wants to help - let me know!
React testing series - react-testing-library, Nock and Mastering Jest
Tags: react, testing, tutorial, webdev
Published: 2019-03-24 18:44:52

Follow me on [Twitter](https://twitter.com/chris_noring), happy to take your suggestions on topics or improvements /Chris

This is a three part series consisting of the following:

- [Using react-testing-library to test the component surface](https://dev.to/itnext/how-you-can-use-react-testing-library-to-test-component-surface-49pm), This great library by Kent Dodds shows how you can focus on testing the surface of your components instead of its internals
- [Jest fundamentals](https://dev.to/softchris/testing-your-apps-like-a-boss-with-react-js-and-jest-1hkh), this is a really great library that makes the testing experience really enjoyable. Zero config, snapshots, smart defaults when it comes to mocking and limit what you with test using patterns in the Jest CLI
- [Nock](https://dev.to/softchris/http-mocking-for-your-tests-in-react-26f6), is a great library that makes mocking HTTP calls really easy
DB2: Execute reorg from JDBC based tool
Tags: db2, jdbc
Published: 2019-03-24 16:30:01

---
title: DB2: Execute reorg from JDBC based tool
published: true
description: 
tags: db2, jdbc
---

When using DataGrip, DbVisualizer, SQuirreL or any other JDBC based tool:
```
CALL SYSPROC.ADMIN_CMD ('REORG TABLE TABLE_NAME')
```

It should work also with other db2 client native commands.
Don't copy and paste git changed files path anymore, use 'git add -i'
Tags: git, beginners
Published: 2019-03-24 16:13:05

---
title: Don't copy and paste git changed files path anymore, use 'git add -i'
published: true
description: A useful tip to add changed files to a commit on git command-line
tags: git, beginners
---

It's usual to see beginners developers copy and paste paths when they are pushing some change on git repository. A good way to avoid it is use 'git add -i' and select files that you want to add.

**A brief explanation of -i argument**

"    *Add modified contents in the working tree interactively to the index. Optional path arguments may be supplied to limit operation to a subset of the working tree. See “Interactive mode” for details*." (https://git-scm.com/docs/git-add)

``` 1 - Inside a git repository type git add -i```
``` 2 - Type 2 to update``` 
``` 3 - Type the file numbers to add, you can specify comma separated values (1,2,3) or an interval (1-7) to add at once.``` 
``` 4 - Hit Enter ``` 
``` 5 - Type 7 to quit interactive mode  ``` 

```tip: To remove some file you can type -fileNumber. Ex: -5,-1 ```


![git add -i example](https://thepracticaldev.s3.amazonaws.com/i/szp78xrlds1kys38pnrc.png)


:) :) :)
Bash: reading lines
Tags: shell, bash, linux
Published: 2019-03-24 16:06:15

---
title: Bash: reading lines
published: true
description: 
tags: shell, bash, linux
---

Reading lines from a $FILE in bash:
```
while read LINE
do
    echo "$LINE"
done < $FILE
```

Reading from standard input:
```
while read LINE
do
    echo "$LINE"
done <&0
```

Reading lines from a file as a script parameter, and if it's not found, from standard input:
```
while read LINE
do
    echo "$LINE"
done < "${1:-/dev/stdin}"
```
Source: http://mywiki.wooledge.org/BashFAQ/024
Bash: loops
Tags: shell, bash, linux, loop
Published: 2019-03-24 16:00:16

---
title: Bash: loops
published: true
description: 
tags: shell, bash, linux, loop
---
Different loop styles in bash:

```
for i in $( ls )
do
    echo $i
done
```
```
for i in $( seq 1 10 )
do
    echo $i
done
```
```
for ((i = 0 ; i < max ; i++ ))
do
    echo $i
done
```
```
i=0
while [ $i -lt 10 ]
do
    echo $i
    i=$((i+1))
done
```
```
i=20
until [ $i -lt 10 ]
do
    echo $i
    i=$((i-1))
done
```
Set current date behind a proxy
Tags: linux, shell, curl
Published: 2019-03-24 15:45:56

---
title: Set current date behind a proxy
published: true
description: 
tags: linux, shell, curl
---

If you system is behind a proxy and NTP can't be used, you might try this little trick:

```
sudo date -s "$(curl -s http://www.timeapi.org/utc/now)"
```
Be advised that after some time, your computer clock might drift away from standard clock. So this is just a temporary solution.
Why Vim and Neovim communities need keep interacting?
Tags: vim, neovim
Published: 2019-03-24 13:53:51

---
title: Why Vim and Neovim communities need keep interacting?
published: true
description: Great Ideas keep comming up from both communities 
tags: vim, neovim
---

After watching a great speech from Bram Moolenar entitled: ["From hjkl to a platform for plugins"](https://www.youtube.com/watch?v=ES1L2SPgIDI) I realized that some of Moolenar's ideas could be completelly ignored on the Neovim community and at the same time some of Neovim new features and ideas could not be reaching the entire Vim community. I think both sides have to work with the cooperation spirit in mind.

Actually I don't know how much both communities have interacted lately, however I think some people could be more connected on one side and ignoring the other. 

We have seen many Linux distros using ideas that were not origanally from their core. After git as a inovatory control version system, github, bitbucket and many other version control revolutionary platforms we have seen a huge improvement on how sofware is made. Neovim came up from this revolution, as Isaac Newton once sayd: " If I have seen further it is by standing on the shoulders of Giants!". 

Instead of trying to describe what I have seen in the Moolenar's speech I leave it up to you guys, just set some time to watch the speech and spreed the word. 

In my humble opinion this is an auspicious moment to the Vim and Neovim communities. The birth of neovim influenced the vim community and I hope that the Neovim community learns the lesson and keep an eye on the Vim communitie ideas. It will be great to see a positive dispute. 

I hope this little text had called people's attention enough to how great both sofwares can be if their communities interact more instead of fighting each other and I know there are a lot of people in both sides who have this in mind. I just wish this become a common place.

*The speech slides can be seen in [this link](https://vimconf.org/2018/slides/Vim_From-hjkl-to-a-platform-for-plugins.pdf)*

*Neovim will bring us a lot of new features and if you wanna become informed just see: 
[the summer code 2019](https://github.com/neovim/neovim/wiki/GSoC-2019-Ideas)*
Is using git without the command line cheating?
Tags: discuss
Published: 2019-03-24 15:10:04

I was really scared of git in the beginning. My first instance with it besides being added to a repository I worked as an artist on was with a friend making a game. I now know our issues stem from not using the Unity gitignore settings, but back then it was a mess of commands I didn't understand to try and fix our problems, back when I still thought I was too dumb to code. I thought somehow I had messed everything up, when it just turns out our project settings and libraries were clashing.

Because of this, when I finally started using GitHub I used GitHub desktop, and eventually used the functionality in VS Code. Is this considered "cheating" since I never use a terminal for git, or even know the commands to do so? What am I missing out on when I don't know these things?
How to read others' code?
Tags: discuss, webdev
Published: 2019-03-24 15:07:19

I am wondering what are the best strategies to read others' written code, especially when it is not well commented, or documented. Add to that if it uses libraries and technologies that are new to you. 
I heard about what is called "_*reverse engineering*_" and that it could help tracking the code and spotting bugs. What you know about it and how could one improve his/her ability to make the best out of it?
Stadia could enable 3D websites for all
Tags: stadia, vulcan, webgl
Published: 2019-03-24 14:51:38

---
title: Stadia could enable 3D websites for all
published: true
description: Google Stadia could enable 3D websites for a much wider audience
tags: stadia, vulcan, webgl
---

![Stadia Icon](https://stadia.dev/static/images/favicon/touch-icon-180x180.png)

It's been a long dream of mine to create 3D websites, since webgl became a thing. What makes this tech extremely exciting is what you can do with Shaders NOT 3D worlds. In a mobile first scenario, this is just not feasible. We need to do all of the computations on the client which preclude all devices but desktops.

Enter Stadia. https://stadia.dev/about/ With Stadia tech, Vulcan from Khronos, on Google Cloud, we can render the website server-side and stream it to devices with high bandwidth connection. This open up webgl to a much wider audience.

Even if the tech is based on open source software, Linux, and API, Vulcan. It only runs in Google Cloud which mean it's far from suitable for websites today but this is early days for the tech and who knows how many hosts we will have in the future. For now, I just want to put the idea out there. I'm cautiously excited. This could be a game changer or it could never happen.

Also posted on reddit: https://www.reddit.com/r/web_design/comments/b4vt19/stadia_to_enable_3d_websites_for_all/
creating wordlist with python to bruteForce
Tags: python, wordlist, bruteforce
Published: 2019-03-24 13:52:06

---
title: creating wordlist with python to bruteForce
published: True
description: how to create a website using python
tags: #python #wordlist #bruteforce
---
 """Wordlist can be used for brute force.
"""

#creating wordlist with python 

import itertools

letters = "1", "2", "3", "4", "5", "6", "7", "8", "9", "0"
n = 6

#Creating wordlist
file = open("wordlist.txt", "w")

# Generate combinations and then write to "wordlist"
for wl in itertools.product(letters, repeat = n):
    file.write("".join(wl) + "\n")
Any advice for a person reaching the 4 year mark?
Tags: discuss, career
Published: 2019-03-24 12:45:28

---
title: Any advice for a person reaching the 4 year mark?
published: true
description: 
tags: #discuss #career
---

I suddenly realized that I'm reaching my 4th year in the industry this June. This feels like a monumental time just like my senior year in university. And so it made me look back on my progress so far. 

What are things you wish you've known or things you hope to achieve by the time you reach 4 years in the work force?