teleren/devto huggingface dataset:
カレンダーの行数を求める
Tags: java
Published: 2018-03-09 13:56:30

---
title: カレンダーの行数を求める
published: true
description: 
tags: Java
---

カレンダーの行数を求める。

算出方法は以下を参考。
https://biz.hino-tama.com/creative/blog0012/

```java
int calendarRows(LocalDate date) {
    if (date == null) {
        throw new IllegalArgumentException();
    }
    
    LocalDate firstDay = date.with(TemporalAdjusters.firstDayOfMonth());
    DayOfWeek dow = firstDay.getDayOfWeek();
    Month month = firstDay.getMonth();
    
    if (DayOfWeek.SATURDAY.equals(dow)) {
        return Month.FEBRUARY.equals(month) ? 5 : 6;
     }
    
    if (DayOfWeek.FRIDAY.equals(dow)) {
        return firstDay.lengthOfMonth() == 31 ? 6 : 5;
    }
    
    if (DayOfWeek.SUNDAY.equals(dow) && Month.FEBRUARY.equals(month)) {
        return firstDay.isLeapYear() ? 5 :4;
    }
    
    return 5;
}
```
AdonisJs Lucid Relationships
Tags: adonisjs, node
Published: 2018-03-09 13:17:56

---
title:  AdonisJs Lucid Relationships
published: true
description: In this series, we'll look at how to work with Lucid relationships.
tags: adonisjs, nodejs
---

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

In this series, we'll look at how to work with Lucid relationships. We'll start by covering how to define each of the relationships types supported by Lucid. Then we'll look at how to perform database operations with each relationship.

{% youtube PD-kdpIbUEM %}

### Related tutorial
[Getting Started With Lucid: AdonisJs ORM](https://dev.to/mezie/-getting-started-with-lucid-adonisjs-orm--2258)
Getting Started With Lucid: AdonisJs ORM 
Tags: adonisjs, node
Published: 2018-03-09 13:12:54

---
title:  Getting Started With Lucid: AdonisJs ORM 
published: true
description: Lucid is AdonisJs ORM. In this tutorial, I show you how to get started with Lucid.
tags: adonisjs, nodejs
---

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

Lucid is AdonisJs ORM, which is an implementation of the active record pattern. In this tutorial, I show you how to get started with Lucid.

{% youtube CxeQexPV-M8 %}

### Related tutorial
[AdonisJs Lucid Relationships](https://dev.to/mezie/-adonisjs-lucid-relationships--3110)
[What's New In AdonisJs 4.1](https://dev.to/mezie/whats-new-in--adonisjs-41--557a)
CLI apps in TypeScript via ts-node
Published: 2018-03-14 12:16:35

---
title: CLI apps in TypeScript via ts-node
published: true
tags: 
canonical_url: https://www.geekytidbits.com/cli-apps-in-typescript-via-ts-node/
---

I really like the [ts-node](https://github.com/TypeStrong/ts-node) project. It allows you to run TypeScript in Node.js directly, without having to run the files through the TypeScript compiler (tsc), first. It does this by registering a handler for files with the `.ts` or `.tsx` file extentions and relying upon ts-node to marshall back and forth to the TypeScript compiler, on the fly. It also supports a TypeScript REPL which is really neat.

I’ve mainly been using it for unit tests in Node projects ([example](https://github.com/bradymholt/psqlformat/blob/master/package.json#L52)) to avoid having an intermediate build step. Also, increasingly, I’ve been using it to execute TypeScript directly on some of my own server-side projects at runtime. Again, doing this reduces a build-time step and reduces friction.

Lately, I’ve been using Node more and more to write CLI apps and thought it would be neat if ts-node could be used for this as well. It turns out it’s pretty easy.

First, install ts-node:

```
npm install ts-node
```

Then, create your TypeScript module file that will contain your CLI logic.

**cli.ts**

```
export function run() {
  const message: string = "Hello from TypeScript!";
  console.log(message);
}
```

Now, create your entry script. This is the script you will run from your shell.

**my-script**

```
#!/usr/bin/env node

require('ts-node').register();
require('./cli.ts').run();
```

You need to make this file executable first, so run `chmod +x ./my-script`.

Now, you can run `./my-script` from your shell:

```
> ./my-script
Hello from TypeScript!
```

If you make changes to the cli.ts file, they will be picked up the next time you run my-script because the latest is running through ts-node.
Nevertheless, Megan Coded
Tags: wecoded
Published: 2018-03-09 03:28:33

---
title: Nevertheless, Megan Coded 
published: true
tags: shecoded
---

## I began to code because...

...my older brother did. In high school, everything he did, I did. He played saxophone, I played saxophone. He took computer science classes, I took computer science classes. We’re both engineering managers now.

## I continued to code because...

...I couldn’t get away from it. Started in college as a chemistry major, took a computer graphics class and switched to a computer science major. Worked at ILM aiming for creature dev artist and then effects artist, instead wrote python scripts and tools for artists and loved solving tough problems for the talented artists. After 6 years in visual effects, I left for magical unicorn startup land. I found Bloc and dove into code, building out the platform that allows so many people pursue their own development and design career. 


## I want to brag about...

...the kickass female engineers on our engineering team. I manage the engineering team at Bloc, an online education company for anyone that wants to become a web developer or designer. 

Courtney is coming up on her 1 year of contributing on the engineering team. She took Galvanize bootcamp on a full-ride scholarship and is a constant learner. After just a year, we can really trust her with building any new feature for our students and mentors. She’s a great pair when you need another brain on the problem.

Meghana just started on our team last week as an intern after completing the web developer track program. You could call her the bug crusher, already fixing so many bugs in her first two weeks. Her first career was in hardware, she took a break to raise her two kids, and now she joins us in her first software development job.

Today, we had a afternoon learning session and discussed block scoping, let, and const. Great way to celebrate international women’s day.

## My advice for allies to support women and non-binary folks who code is....

...assume we are there to attend the conference if we’re at the conference. Assume we have interesting and influential opinions if we’re in the meeting. Give us feedback and challenge us in the same way you challenge all your colleagues. We can do the same for you!
What's New In  AdonisJs 4.1
Tags: adonisjs, node
Published: 2018-03-09 12:57:33

---
title: What's New In  AdonisJs 4.1
published: true
description: A walk through the improvements and changes added in AdonisJs 4.1
tags: adonisjs, nodejs
---

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

AdonisJs 4.1 was released not too long ago. In this video, I will walk you through the improvements and changes added in the latest version of the AdonisJs framework.

{% youtube Li6dQAKMGTA %}

### You might also like
[Complete Authentication In AdonisJs](https://dev.to/mezie/complete-authentication-in-adonisjs--2je4)
Create your developer landing page with GitHub Pages 🎉
Tags: github, website, code, tutorial
Published: 2018-03-09 12:46:14

---
title: Create your developer landing page with GitHub Pages 🎉
published: true
description: Minimal Developer Landing Page in minutes
tags: github, website, code, tutorial
---

![Developer Landing Page with GitHub Pages](https://image.ibb.co/jrzpdS/dev_landing_thumb.png)

_All of us devs, at one point or other, would have wanted to have a personal website of our own, either to showcase our online presence or just 'coz it's fun. So here, I present you a ready-made **[Developer Landing Page](https://github.com/flexdinesh/dev-landing-page)**_

Usually creating a personal website would involve buying/registering a domain name, finding a free/paid hosting service, developing your site and uploading it to the hosting provider.

But with [GitHub Pages](https://pages.github.com/), publishing your site is as easy as drinking a coffee.

* You need a GitHub account (you obviously have one already)
* Create a new repo with the name `{username}.github.io`
* Clone the repo and create an `index.html` file
* Add some content and `git push`

Voila! Your site should be live at `https://{username}.github.io` in seconds.

## Developer Landing Page

I wanted a **Dev Landing Page** to showcase everything I do online. And I wanted it to be **minimal** and right to the point rather than beautiful and hefty. So I sat down one night and created this **[Dev Landing Page](https://github.com/flexdinesh/dev-landing-page)**.

Few of my friends liked it and I created the same in a few different themes for them.
And I think for most of the devs out there would like to have something similar. So if you're not looking for something fancy and like this minimal **[Dev Landing Page](https://github.com/flexdinesh/dev-landing-page)**, feel free to fork/clone and customize it to your dev taste.

You can pick from one of these **9 material themes** or change the colors it to suit your taste 'coz it's just too easy.

![9 Material Themes](https://image.ibb.co/jJVKCn/dev_landing_page_themes.jpg)

Here's my **[Dev Landing Page - Dinesh](https://flexdinesh.github.io)**, shining bright in my favourite yellow! 🎉

You are amazing! Have a great day! ✨
Beyond the login screen - Part I
Tags: security, transparency, openidconnect, dataprivacy
Published: 2018-03-09 11:49:15

---
title: Beyond the login screen - Part I
published: true
description: Why we need to think about Open Standards for Authentication and Authorization
tags: #security,#transparency,#OpenIDConnect,#dataprivacy
cover_image: https://thepracticaldev.s3.amazonaws.com/i/qilhl5z77k9vnql942cr.jpeg
---

Recently I came across this tweet,

{% twitter 970144255745212416 %}


This tweet got me thinking, Personal data even how trivial it is can be dangerous in the hands of a wrong person. But can we stop collecting data about the user? Can we say with certainty that the system we are building is impenetrable? 

We as part of a product team has responsibility to be transparent to our users about **What** data of the user our product needs and **Why** the user has to share it, So the user is conscious of the data being shared and there by implications.

Let us not be very greedy to ask for all data at once from the user. 

<img src="https://thepracticaldev.s3.amazonaws.com/i/izfgmkdmn4w11rtz0ocj.gif"/>

I think we can also apply lean principle in collecting the data from the user, by asking for user's data only when we need them and of course explaining the Whats and Whys.

We can craft a unique solution for each of our suite of products ourselves or we can abstract away the method of collecting some of the most common user data that we collect in a safe, secure and trusted way. 

There are a number of Open standards for exchanging the authentication and authorization data between users and services/products. Most popular among them are SAML, OAuth2 and OpenId Connect. These standards gives us the trust that a user data is exchanged in a secure manner that is transparent to the user.

Let us bring a change in thought process that authentication or authorization is not mere a login screen. Let us think about these aspects early in our product design phase.

So may be it is time for us to think about these Federated Authentication and Authorization standards, that gives users the **right to grant and revoke access to their data** at any point?

In the next part , I will go deeper in to one of these Open Standards OpenID Connect..
How to remove Powered by Prestashop from email templates
Tags: blog, prestashop, tutorials
Published: 2018-04-12 08:17:08

---
title: How to remove Powered by Prestashop from email templates
published: true
tags: blog, prestashop, tutorials
canonical_url: https://www.prestasoo.com/blog/how-to-remove-powered-by-prestashop-from-email-templates.html
---

![](https://www.prestasoo.com/images/stories/how-to-remove-powered-by-prestashop-from-email-templates.jpg)

I've received many questions from clients about how to remove "[Powered by Prestashop](https://www.prestasoo.com/blog/how-to-remove-powered-by-prestashop-from-email-templates.html)" from emails. Well, your ecommerce site is (almost) running, but you don't like the way your emails look, especially the bottom part "My site powered by Prestashop" that make you look like an amateur.

Maybe you would like to display there your own message for your customers or remove it for good. On this [Prestashop Tutorial](https://www.prestasoo.com/blog/how-to-remove-powered-by-prestashop-from-email-templates.html), i will show you how to remove it or display your own text.
How Do You Feel About Progressive Web Apps?
Tags: discuss
Published: 2018-03-09 05:39:57

---
title: How Do You Feel About Progressive Web Apps?
published: true
tags: discuss
---

What do you guys think about progressive web apps? 

I wrote an article about the basics of [what makes a progressive web app](https://ua1.us/news/progressive-web-apps/what-is-a-progressive-web-app/) and was just wondering what everyone thinks about progressive web apps?
Running NodeJS Forever!
Tags: tutorials, express, node
Published: 2019-10-11 04:27:38

---
title: Running NodeJS Forever!
published: true
tags: Tutorials,ExpressJS,NodeJS
canonical_url: 
---

# Introduction

NodeJS is a great tool for web development, but it has it’s hang-ups. When setting up an Express Server with NodeJS, many restarts are required and expected during the development stage. Not only that, but it would be great to keep a NodeJS project running indefinitely once you close your terminal session. This tutorial aims to address both of those issues. This tutorial will start by addressing the desire to keep a nodeJS process running and will then address reloading the process when changes are made. I will do this by addressing different tools used to accomplish these tasks and will end with my preferred option. Let’s begin.

NOTE: THIS IS COPIED FROM A WORDPRESS BLOG AND THEREFORE SOME STYLES AND TEXT DID NOT TRANSFER OVER PROPERLY

* * *

# Video (for all of you non-readers out there)

{% youtube 7fpSFwwNqYA%}

* * *

# The Options:

## Tmux/Screen (Okay Option)

Tmux and Screen are terminal multiplexers that allow you to create “sessions” that can persist after you close your terminal. They create their own sockets that a terminal instance runs in. A user can then access this through their tool’s commands. Once inside one of these sessions, running a command with node and then leaving the session will not end the node process because the terminal session is still open. I won’t go into detail here, but if you watch the video, I will show how to do this with tmux.

## Nodemon (Better Option)

One of the issues with the above method is that you still need  to stop and restart the node process every time you make a change to the server. One work-around for this is to install nodemon, a nodejs wrapper that watches the files in the directory it is run it and restarts. Nodemon is a node module and can be installed with npm. Combining nodemon with tmux or screen will allow you to run a node server that restarts whenever a change occurs. There is an easier way.

## PM2 (Best Option)

PM2 is a Process Manager for NodeJS. Like nodemon, it is also installed globally through npm. Unlike nodemon, pm2 actually creates a system process independent of any terminal instance to run your node process in. The video shows how to set it up after installing so I won’t discuss it here. [They have some great documentation at their site.](http://pm2.keymetrics.io/docs/usage/quick-start/)

* * *

# Conclusion

There are different ways to accomplish the task of running node forever, but my favorite, since I first started using it, is PM2. It allows users to monitor multiple node processes, watch the files for changes, and even run in a clustered mode for load-balancing purposes.
Publish Single Directories to Another Branch
Tags: git, trick, short
Published: 2018-03-09 04:04:37

---
title: Publish Single Directories to Another Branch
published: true
description: I can't believe I didn't know about this command at all, but it helps me publish a javascript project's dist folder to GitHub Pages.
tags: git, trick, short
cover_image: https://thepracticaldev.s3.amazonaws.com/i/wtih9ur6g1zfkh2v07eu.jpg
canonical_url: https://www.assertnotmagic.com/2018/03/08/publish-directories-to-github-pages/
---

Quick Tip!

Let's say that you're just like me.  You've been working on a web project: HTML, CSS, and maybe some JavaScript.  You're done and you're ready to show the world your project, so you want to get it built, compiled, minified, and put it somewhere.  But how?  `git subtree`.  I'll show you.  One command.

*Also, did you see the cover image?  Subtree?  HA!*

Let's assume you've got a project laid out like this:

```
my-dope-project
|- README.md
|- src
|   |- index.html
|   |- css
|       |- styles.sass
|   |- js
|       |- main.js
|       |- helper.js
|- dist
|- webpack.config.js
|- package.json
|- .gitignore
|- node_modules
    |- OMG so much stuff
```

Or something.  I don't know your life.  So you build your site with an `npm run build`.  Now your `dist` directory is full of your beautiful bundled new site.  So how do you put it up somewhere?

## 1. Make sure the dist folder is actually checked into your repo.

Get it out of your `.gitignore` and `add/commit/push` it.

## 2. Use the Subtree, Luke (and/or Leia).

```bash
$ git subtree push --prefix dist origin gh-pages
```

Here, `dist` is the directory subtree you want to publish.  `origin` is the remote repo you're pushing to.  `gh-pages` is the name of the remote branch you want to push to.

Then go to your GitHub and into your repo settings.

![GitHub Pages Settings](https://assertnotmagic.com/img/gh-pages-settings.png)

Set the branch that you created to be the public branch.  And that's it!  Head to `<your-username>.github.io/<repo-name>` and do your happy dance!

I know that there are about a thousand ways you could skin this particular cat and they all have their pro's and con's.  I just really wanted to share this particular approach because I thought it was neat.  Happy coding!

<hr>

*Originally published on [`assert_not magic?`](https://assertnotmagic.com/2018/03/08/publish-directories-to-github-pages/)*
Nevertheless, Kausali Coded
Tags: wecoded
Published: 2018-03-09 03:26:39

---
title: Nevertheless, Kausali Coded 
published: true
tags: shecoded
---

## I began/continue to code because...


Since a very young age I thought I wanted to become a dentist or a nurse or at least I thought I wanted to work in a healthcare field. I grew up in an Asian community where my society programmed my mind in such a way that made me think "Since I am a woman, I should be in a medical field if I want to be taken seriously". I studied Biology, Chemistry, physics and Math throughout my high school. When I came to the States I decided to pursue my undergrad in Health Services Administration. Luckily at that time I got to work as a Helpdesk technician, which opened my eyes in terms of what tech meant for any organization. I wasn't coding at that time and I for sure didn't even know what coding was. But I was always curious about how apps were built, and how codes work to create something. There were moments when I wanted to change my major to CS but I never had the confidence to make that change. Because I was scared to fail and I was scared that I wouldn’t be successful. Every time I thought I wanted to change my major I had Millions of thoughts going in my mind. “What if I can’t do it? What if this is a wrong decision” Because of all the “What ifs” it took me until I was in my senior year to realize that I wanted to learn to code and by then it was too late for me to change my Major. After my Graduation, I worked for this Amazing Company as a Service Desk Analyst. After few months, I was working very indirectly with developers and I was very much fascinated with what they were doing behind the scenes. My passion to learn to code grew even more. I was doing well at my job and I was in the verge of getting promotion but this one time I decided to follow my passion. So, quit my job to join a coding bootcamp. It was by far one of the best decisions I ever made. Soon I was building games and web apps on my spare time. It opened many doors for me and that’s one of the reason I am here today sharing my story 


## I want to brag about...

...  My role as Software Engineer!! I am learning and growing everyday as a developer and I absolutely love it!!


## My advice for allies to support women and non-binary folks who code is....

If you want to code or want to learn how to code just go for it. Do what you are passionate about and take risk and ohh don't forget to enjoy the journey.
My age and coding
Tags: discuss
Published: 2018-03-09 02:06:30

---
title:  My age and coding
published: true
description: I still continue
tags: discuss
---

## A post inspired me to write
I encourage myself to write, I have read several posts of codifying women and all the things that have had to happen and still pass. for me, a girl that codifies is great, in fact, I admire them.
But what happens to me is that I began to learn to code, I think I am very old, because I studied public accounting but before finishing the degree I was already attracted by the computer.


##Doing everything possible

I learned some things on my own, and with my study and new skills I got a job in the systems department. This brings me closer to this world. but what related to networks, server administration.

##The time has come
Then I do not know when my interest came in the development of websites, as new world opened before me. the programming there started a friend recommended me to learn javascripts and so I did, but I made many breaks until I decided to learn completely.

##If a new world

 decided to learn online courses, there were more resources, I discovered new things. until it became more serious to do some online specilizations in some very good sites, my skills were growing, but I still feel that I'm still missing that you started very late. but then I feel on my lapto learn and all those fears are gone.

##Motivate


My advice and I do not know if I am able to give it, is focused, I spent a lot I wanted to learn many things, I appeared rubi then I deviated from javascript, appeared python and neglected the other two, mobile development.
When I decided to focus and concentrate on one, I can acquire new skills and develop something complete. what a great feeling of truth. Well I'm still in this and I hope I'll continue ..
Great site
That's it
Nevertheless, Karolina Jiménez Coded
Tags: wecoded
Published: 2018-03-09 00:47:37

---
title: Nevertheless, Karolina Jiménez Coded 
published: true
tags: shecoded
---

## I began to code because...

I was lost... I had just finished my Bachelor's Degree in Commerce, was working full time and halfway through my thesis. Then one day, I realized that nothing of what i was doing was fulfilling me, nothing was exciting neither challenging, there was no purpose. Nothing was taking me to the next step of the ladder. That's when after years and years of having a voice next to me telling to learn code hit me like a stroke.

For the first time, I took it seriously and didn't fell asleep during my study time (maybe just a couple of times). Being able to build something from scratch and knowing that those lines that I had written could help someone in the future, gave my breath back.

I am still discovering that path, but everyday that passes I am more sure that it is the right one.

## I recently overcame...

My constant negativity, this by learning to be more resilient. 

## I want to brag about...

The fact that I have been able to understand more everyday. 

## My advice for allies to support women and non-binary folks who WANT TO code is....

Go for it! It is never to late, if you love it you will find time. Don't be afraid, we are more in this than you will ever imagine.