teleren/devto huggingface dataset:
Laragon - How to upgrade Apache Server 2.4.41 and PHP 7.4.2
Tags: laragon, apache, web, php
Published: 2020-03-07 06:08:39

---
title: Laragon - How to upgrade Apache Server 2.4.41 and PHP 7.4.2
published: true
description: How to upgrade PHP and Apache for your Laragon server.
tags: laragon, apache, web, php
---
One of the currently easiest to configure web servers for web apps development is Laragon. It let us create different kinds of development applications, from a Laravel project to a WordPress site with just one click. This is my preferred server over my previous WAMP configuration.
<b>After installation of Laragon, it brings previous versions for both, Apache and PHP, so we will upgrade their versions to the latest. </b>

First download and install the latest Visual Studio C++ redistributables from the Microsoft site

https://support.microsoft.com/es-pa/help/2977003/the-latest-supported-visual-c-downloads

Now we should download both packages from their webpages and unpack then, download the 32 or 64 versions that suits your OS, this are the links:
 
https://www.apachelounge.com/download/
https://windows.php.net/download#php-7.4

If you have Laragon server running stop it.

After unpack then, copy both folders to the Laragon/bin folder, inside their respective package name, (the new Apache folder that you download inside Apache folder in Laragon/bin and the new PHP inside the PHP folder).

then edit the file php.ini with your preferred text editor and search for the line that reads "; Be sure to appropriately set the extension_dir directive". Replace with this text until the place that reads "Module Settings".


; Be sure to appropriately set the extension_dir directive.
;
extension=php_bz2.dll
extension=php_curl.dll
;extension=php_com_dotnet.dll
;extension=php_enchant.dll
extension=php_fileinfo.dll
;extension=php_ftp.dll
extension=php_gd2.dll
extension=php_gettext.dll
extension=php_gmp.dll
extension=php_intl.dll
extension=php_imap.dll
;extension=php_interbase.dll
extension=php_ldap.dll
extension=php_mbstring.dll
extension=php_exif.dll ; Must be after mbstring as it depends on it
extension=php_mysqli.dll
;extension=php_odbc.dll
extension=php_openssl.dll
;extension=php_pdo_firebird.dll
extension=php_pdo_mysql.dll
;extension=php_pdo_oci.dll
;extension=php_pdo_odbc.dll
;extension=php_pdo_pgsql.dll
extension=php_pdo_sqlite.dll
;extension=php_pgsql.dll
;extension=php_phpdbg_webhelper.dll
;extension=php_shmop.dll

; The MIBS data available in the PHP distribution must be installed.
; See www.php.net
;extension=php_snmp.dll

extension=php_soap.dll
extension=php_sockets.dll
extension=php_sqlite3.dll
;extension=php_sysvshm.dll
;extension=php_tidy.dll
extension=php_xmlrpc.dll
extension=php_xsl.dll
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;


Now let’s start Laragon server again and after it finish to load, select web link from the Laragon Menu, it will load your Laragon localhost page, there you should see your current Apache and PHP version, and your new upgraded versions.

Now, we are ready to work again…
Day 2: Aim your energy at the right thing
Tags: beginners, devjournal, life
Published: 2020-03-07 06:01:44

Don’t view your perfectionism as a bad thing, view it as a special energy which you have to point at the right thing

Ask your self these questions:
Are you doing this for work or hobby? (I want to expand on this soon)
Are you doing this because of your perfectionism?
File Handling in Python

Published: 2020-03-07 05:59:03

File handling in Python is a very critical and beneficial area for programmers coding as it is the cornerstone for performing writing and reading operations in a file. Performing ‘read’ and ‘write’ operations are the most extensively costly operations that one can perform and so attempting to optimize the operation of even a single program can positively affect the overall turnaround time of an entire application. Performance is known to increase drastically if one knows to efficiently handle the file handling options in Python while programming. So let us start with the basics to enhance further understanding.

Learn more:https://www.besanttechnologies.com/training-courses/python-training-institute-in-chennai

Meaning of the term – ‘File’

A file is an entity that is given a unique name to store data records for the sole purpose of storage and retrieval as and when needed. They can be kept stored for indefinite amounts of time in devices like hard disc or they can also be placed in volatile memory like random access memory (RAM). In the case, if you need to view or perform read or write operations, you have to first open the file. And when all the necessary actions are finished performing, we have to close it to indicate the closure of actions.
Give pair programming another chance
Tags: pairprogramming, learninpublic, softwaredevelopment, agile
Published: 2020-03-07 05:46:02

Pair programming has a special place in my heart. It played a huge role in my growth as a software developer. It gave me a chance to work on projects that would have been out of my reach. It meant I got to work closely on a daily basis with developers on a whole other level than me. From what I hear when I talk to others, it doesn’t seem like pair programming has broad appeal. My suspicion is that many people have experienced a crude, half-baked version of pair programming, one that poses many more challenges than benefits.

Pair programming can look a lot of different ways, and it needs to to conform to different workplaces, [different power dynamics](https://twitter.com/sarahmei/status/991015072007733248?s=20), and [varying needs of the developers](https://twitter.com/sarahmei/status/990978689557970944?s=20) and project. That said, I want to touch on some of the things that worked for me.

Pair programming has to be an intention, something that is deliberately practiced day-to-day by two developers that want to work together. It is a constant negotiation of preferences and priorities. At each turn you have to communicate about who is driving (typing), about what particular problem you are solving, and about what your thought process is.

And this is where it gets good. Rather than charging ahead with wild abandon like you might do on your own, you first have to articulate your thought process. To have to put into words a theory that you have is to peel that theory out of your brain and try to materialize it in a way that makes sense to your pair. In doing this you are confronted with the holes and assumptions that riddle your theory. You quickly become better at drawing more sound conclusions, you learn to articulate your ideas in ways that you couldn’t before, and you spend significantly less time chasing the theories that you haven’t thought through.

To me this is the exciting stuff. You become a better problem solver. You become a better communicator. You spend way less time feeling isolated. The rest are just side benefits, things like picking up small programming and workflow tips, having a partner to help keep you focused, and not having to type the entire day.

Pair programming is not easy. It takes a lot of work, practice, trust, and respect. It's not even right for every situation. For many people who have written it off, I think pair programming deserves a second chance. If you can find a good pair and the right environment, I think you'll love it.
Nevertheless, Sarah Coded
Tags: wecoded, motivation, career, journey
Published: 2020-03-07 05:29:22

---
title: Nevertheless, Sarah Coded 
published: true
tags: shecoded, motivation, career, journey
---

:wave: Hi, I'm Sarah - and here's my story. 

There were so many directions I wanted to go career wise growing up. My first memory of what I wanted to do was be an archaeologist. Next, I wanted to be an Olympic athlete, then an artist. To be honest, art is where I thought I'd end up until my mom pretty much told me to get into business, and so... I took Marketing in college. 

Long story short, you never know where you'll learn your passions or when you'll figure out what it is you want to do when you "grow up". I truly believe that each experience you're faced with will guide you towards where you're meant to be, and this is what happened to me. 

Marketing introduced me to HTML + CSS, which then led me to complete a web development certificate program at a local college. I was then introduced to JavaScript and from there I continued learning and integrating code into my jobs. Saying "YES" to projects I wasn't sure I could do (building responsive landing pages) just so I could gain experience, challenge myself and really follow this passion. It finally hit me, I realized this was the path I wanted to follow. I applied for a coding scholarship (Edie Windsor Coding Scholarship) and got it! I attended Flatiron School for Software Engineering (Nov 2018 - Dec 2019), and here I am, searching for my first dev job, pushing through all obstacles being a queer woman of colour transitioning careers and breaking into tech. But guess what, I'm going to hit my goal. :muscle: I know it! I didn't come this far for nothing.

The funny thing is, art has always been my number one. I loved creative thinking, designing, building and planning out projects. From ideation to creation with many iterations in between. Web development is my new form of art, still doing everything the young girl in me loved, I just traded brush strokes for keystrokes. :heart:
Nevertheless, Serhii Konovalov Coded
Tags: wecoded
Published: 2020-03-07 05:17:08

---
title: Nevertheless, Serhii Konovalov Coded 
published: true
tags: shecoded
---
<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

## Equality in tech looks like… 

## I’m an expert at…

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

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
Setting up a Vue CLI project with Vue Apollo
Tags: graphql, vue, apollo
Published: 2020-03-07 05:11:32

> Today we’ll learn how to integrate `apollo-client 2` with Vue.js using `vue-apollo`.

## Installation
`apollo-client` has numbers of dependencies that need to be setup in your current Vue CLI project.
```
npm install --save vue-apollo graphql apollo-client apollo-link apollo-link-http apollo-cache-inmemory graphql-tag
```
## Usage
- Set up an `ApolloClient` in our main.js.
```js
import { ApolloClient } from 'apollo-client'
import { createHttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'

// HTTP connection to the API
const httpLink = createHttpLink({
  // You should use an absolute URL here
  uri: 'http://localhost:3020/graphql',
})

// Cache implementation
const cache = new InMemoryCache()

// Create the apollo client
const apolloClient = new ApolloClient({
  link: httpLink,
  cache,
})
```
- Install the `VueApollo` plugin into Vue
```js
import Vue from 'vue'
import VueApollo from 'vue-apollo'

Vue.use(VueApollo)
```
- The `ApolloProvider` holds the Apollo client instances that can then be used by all the child components.
```js
const apolloProvider = new VueApollo({
  defaultClient: apolloClient,
})
```
## The final step
Extracting the apollo component to a single file, create a file called `apollo.js` in `src/graphql/apollo.js` and add
```js
//apollo.js 
// This is everything we need to work with Apollo 2.0.
import Vue from "vue";
import { ApolloClient } from "apollo-client";
import { HttpLink } from "apollo-link-http";
import { InMemoryCache } from "apollo-cache-inmemory";
import VueApollo from "vue-apollo";
// Register the VueApollo plugin with Vue.
Vue.use(VueApollo);

// Create a new HttpLink to connect to your GraphQL API.
// According to the Apollo docs, this should be an absolute URI.
const httpLink = new HttpLink({
	uri: `http://localhost:3020/graphql`
});

// I'm creating another variable here just because it makes it easier to add more links in the future.
const link = httpLink;

// Create the apollo client
const apolloClient = new ApolloClient({
	// Tells Apollo to use the link chain with the http link we set up.
	link,
	// Handles caching of results and mutations.
	cache: new InMemoryCache(),
	// Useful if you have the Apollo DevTools installed in your browser.
	connectToDevTools: true
});

const apolloProvider = new VueApollo({
	// Apollo 2.0 allows multiple clients to be enabled at once.
	// Here we select the default (and only) client.
	defaultClient: apolloClient
});

export default apolloProvider;

```

Add it to your app with the apolloProvider option, Now our `main.js` will look like:

```js
//main.js
import Vue from "vue";
import App from "./App.vue";
import apolloProvider from "./graphql/apollo";

new Vue({
  el: '#app',
  // inject apolloProvider here like vue-router or vuex
  apolloProvider,
  render: h => h(App),
})
```
You are now ready to use Apollo in your components!
For more details, see the documentation on [apollo-vue](https://vue-apollo.netlify.com/) and [Apollo](https://www.apollographql.com/client/).
How to uncouples emit events from connection event into socket.io and express
Tags: node, javascript, todayilearned
Published: 2020-03-07 04:49:19

# Preface 👓
I've worked in a project with node.js, express and websockets, In a part of the project I realized the need to uncouples the sending of messages to the websocket, since I would need to do this in a place where there was no instance of it, in my case it was on a specific route in the middle of the business rule logic.

I would need to send the return in real time of each stage of this processing, and among all the alternatives, such as passing the socket instance as a route by route parameter (in my project I have unification of the routes by prefix) and having to refactor a lot of the that I had already done, I found this way that I present to you

## Socket.io 📨
Socket.IO is a JavaScript library for realtime web applications. It enables realtime, bi-directional communication between web clients and servers.

Socket.IO **is NOT** a WebSocket implementation. 

Although Socket.IO indeed uses WebSocket as a transport when possible, it adds some metadata to each packet: the packet type, the namespace and the packet id when a message acknowledgement is needed. 

That is why a WebSocket client will not be able to successfully connect to a Socket.IO server, and a Socket.IO client will not be able to connect to a WebSocket server either.

You can see more about socket.io [here](https://socket.io/docs/).

## Socket Service Class ✨
```javascript
const socketIo = require('socket.io');

class SocketService {
   constructor(server) {
     this.io = socketIo(server);
     this.io.on('connection', socket => {
       console.log('user connected')
   });
 } 

  emiter(event, body) {
    if(body)
      this.io.emit(event, body);
  }
}

module.exports = SocketService;

```

## Implementation in app.js 👾
In the main of my application, there I was put the instance of Socket Service as a singleton into express app.

With that I was able to use it on other routes without having to modify anything on them

```javascript
const express = require('express');
const app = express();
const server = require('http').Server(app);

app.use(express.json());
app.use(`/`, require('./routes'));

server.listen(3001, function () {
  console.debug(`listening on port 3001`);
});

 app.set("socketService", new SocketService(server));
```

## Using in the route controller or anywhere you want  🛣
```javascript
//using req to access app that I had defined before
req.app.get("socketService").emiter('message', req.body);

//anywhere with access to app:
app.get("socketService").emiter('message', req.body);
```


that's all, i hope this can help you in your projects!

![](https://media3.giphy.com/media/m9eG1qVjvN56H0MXt8/giphy.gif?cid=790b7611220a88e4c7d7d7c832373007987980fc4e664121&rid=giphy.gif)
I’m an average developer and I’m ok with that
Published: 2020-03-07 02:49:38

I started programming at an age that some people would call “late”. I was 23, not happy with my college major and was looking for something else to do. My wife pointed out that I spent so much time looking at technology websites and thought I should try that, so I did. I switched from exercise science to computer science pretty much the day after talking with my wife. 

I struggled through the program. Up till that point the most programming I had done was super simple webpages with just html and css. I felt so far behind the other students. But at the same time I liked solving the problems and seeing my programs come to life. 

I got B’s and C’s in my classes. I didn’t get an internship until the summer, one semester before I graduated. And I even failed a class the semester before I was suppose to graduate. I was stressed and I worried that I shouldn’t be a programmer. My last semester I worked hard, struggled but I did graduate. I sent out tons of applications, interviewed a few times and pretty much failed all my coding interviews. I’m pretty sure my current employer was desperate and maybe I convinced them enough to take a chance on me. But yes my imposter syndrome was really bad through this whole time. 

Since graduating I’ve struggled with imposter syndrome constantly but I’m working on it. I’ve been making little silly/stupid projects that sound fun to me, I’ve published a few games on itch.io and I’m just constantly reading and learning. Cause really that’s what we developers are. Professional lifelong learners and professional google users.

I don’t plan on making the next Instagram or what not but I do plan on continuing to make things that I find interesting. Because I belief average developers making amazing things to.
How to test exceptions in Jest
Tags: testing, javascript
Published: 2020-03-07 04:21:24

**How to use Jest .toThrow()**

I initially thought that I could do this to unit test for errors

```js
expect(doSomething()).toThrow()
```

Unfortunately, this doesn’t work. We need to wrap `doSomething` in another function in order for this to work

```js
expect(() => doSomething()).toThrow()

//or

expect(function() { doSomething() }).toThrow()
```
Typescript Utility Types
Tags: typescript, javascript
Published: 2020-03-07 04:05:08

## Introduction

As I was starting to get serious in learning Typescript, I came across [a set of utility types](https://www.typescriptlang.org/docs/handbook/utility-types.html) the proved useful when I tried to refactor the types in the codebase of the company that we are in.

Before that point, I assumed that for reusing types code, I have to make granular types and export them to each type that need them in their fields.

For example, if I have a `Person` type that I am using in a `Parent` type or a `Child` type, I have to create it, export it out and use it. Of course this is just a simple example. When we get to having a lot of type sharing across the components, then we can see how it can become unwieldy to import the type every time we try to use that type.

Enter the utility types. These utilities aim to remove the problem of the redundantly defining and importing each functions. I want to go over some of them that I find useful.

## Utilities

###Pick

When we want to reuse or “pick” out some properties inside a type, we would us `Pick`. Very useful as it saves me time having to create new types just to copy the properties of existing types.

```ts
interface Workstation {
	CPU: string
	GPU: string
	RAM: string
	monitor: string
	keyboard: monitor
}

type Computer = Pick<Workstation, 'CPU' | 'GPU' | 'RAM'> 
```

###Partial

When we want to make the properties of a certain type optional, we use `Partial`. Useful when refactoring.

```ts
interface Car {
	wheels: string
	windshield: string
	body: string
	doors: string
}

type Car2 = Partial<Car>
```

###Required

On the other hand, if we want to make the properties of a certain type to be required, we use `Required`. Useful to force your types based on external library types.

```ts
interface OptionalParams {
	a?: string
	b?: string
}

type RequiredParams = Required<OptionalParams>
```

###Record

Very useful when constructing types for configurations.

```ts
interface Person {
	name: string
}

type Family = ‘father’ | ‘mother’ | ‘sibling’

const myFamily: <Family, Person> = {
	father: { name: ‘John’ },
	mother: { name: ‘Jane’ },
    sibling: { name: ‘Joe’ }
}
```

###Omit

Very useful to get a cut down version of a type

```ts
interface Article {
    title: string;
    summary: string;
	  text: string;
    
}

type ArticlePreview = Omit<Article, text>;

const todo: ArticlePreview = {
    title: ‘The misadventures of Joe’,
    summary: ‘Joe goes out of his way to explore. Will he survive?’
};
```

###Exclude

Basically a “complement” of two sets

```ts
type Toys = Exclude<“knife” | “ball” | “xylophone”, “knife”>;  // “ball” | “xylophone”
```

###Extract

Basically an “intersection” of two sets

```ts
type Vehicle = Extract<“skateboard” | “car” | “motorbike”, “car” | “motorbike” | “wheelchair”>;  // “car” | “motorbike”
```

## Conclusion
In my continuous improvement of learning Typescript and trying to incorporate it to my code, I found using these utility types more. As long as I don’t go overboard with them, it helps make my code more concise and understandable. I hope you guys find them useful too.
Active Shooter Response System
Published: 2020-03-07 03:02:53

Hello Everyone,
I have a patent pending for a Active Shooter Response System to stop these Mass shootings I need help to write the framework software I am a inventor not a software writer my idea has been validated by this transaction 
(Startup raises money from Jeb Bush and Bill Gates to stop mass shootings
Evolv Technology, a Waltham, Mass.-based developer of weapons screening systems for large crowds, raised $30 million in Series C funding from such backers as Jeb Bush and Bill Gates.) My system is mobile if your interested please e-mail me at
Airraptor87@gmail.com
Thank you
Nevertheless, Guadalupe Lazzo Coded
Tags: wecoded
Published: 2020-03-07 02:29:01

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->



## Practice makes the master 

My advice for allies to support self-identifying women and non-binary folks who code is you're not alone, we are together on this, don't let anyone to let you down, you can do it, we can do it!
Maybe it take a little more time, maybe not, please don't be shy, we all must be heard

I truly want to see more women tech leaders on job positions, I want to be one of thems.

Equality in tech looks like more voices to discuss important decisions, different opinions and points of view beside the same old ones. 

We should help each other to reach that!

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->
What was your win this week?
Tags: discuss, weeklyretro
Published: 2020-03-07 02:22:37

---
title: What was your win this week?
published: true
description: Got to all your meetings on time? Started a new project? Fixed a tricky bug?
tags: discuss, weeklyretro
cover_image: https://cl.ly/188e843c2985/download/Image%202019-02-15%20at%202.36.37%20PM.png
---

👋👋👋👋

Looking back on your week -- what was something you're proud of?

All wins count -- big or small 🎉

Examples of 'wins' include:

- Getting a promotion!
- Starting a new project
- Fixing a tricky bug
- Cleaning your house...or whatever else that may spark joy 😄

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

Happy Friday!
Nevertheless, sa-mu Coded
Tags: wecoded
Published: 2020-03-07 01:46:01

<!-- ✨This template is only meant to get your ideas going, so please feel free to write your own title & narrative! ✨ -->

## Equality in tech looks like… 

## I’m an expert at…

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

<!-- Once your post is published, it will not appear on the /t/shecoded page until an admin approves it. This is an extra step to ensure there is no abuse on this important tag. -->