teleren/devto huggingface dataset:
List all files changed in last commit
Tags: git, snippet
Published: 2016-02-08 10:53:00

---
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/y9hxcwi5y92j6zfcxbjx.jpg
title: List all files changed in last commit
slug: list-all-files-changed-in-last-commit
date: 2016-02-08 10:53
published: true
tags: 
 - git
 - snippet
---

List all files changed in the last commit by using `git diff-tree` on HEAD.

    git diff-tree --no-commit-id --name-only -r HEAD
    
For example, if you changed README.md in your last commit:

    adam@macbook:project (master) $ git diff-tree --no-commit-id --name-only -r HEAD
    README.md
SQL Transaction Log Backups
Published: 2022-06-22 19:47:04

---
title: SQL Transaction Log Backups
published: true
date: 2016-02-04 20:00:45 UTC
tags: 
canonical_url: https://www.funkysi1701.com/posts/2016/transaction-log-backups/
---

Like many DBAs I spend a lot of time maintaining my SQL Server backups.

From SQL Server I maintain both full backups and transaction log backups. I have often restored my full backups but until recently I have never restored a transaction log backup. All backup strategy’s are only as good as the last time you tested the restore process.

## So what is a transaction log backup?

A transaction log backup contains all the transaction log records generated since the last full backup and is used to allow the database to be recovered to a specific point in time (usually the time right before a disaster strikes). Since these are incremental, if you want to restore the database to a particular point in time, you need to have all the transaction log records necessary to replay database changes up to that point in time.

## How to do the restore.

First right click on Databases in SQL Management Studio and select restore database. You should then get a screen similar to this.

![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2016/02/restore1.jpg?resize=768%2C640&ssl=1)

In source click the … to allow you to select your backup files.

Now normally I have only ever selected one file here, the \*.bak file. Instead select the \*.bak and all the \*.trn files as well. After SQL Server has chugged for a few minutes (time will depend on number of transaction files and server/disk speed etc) the restore plan section should fill up with files.

In the destination database box, type in the name of the database you want to restore. I recommend using a different name to avoid overwriting the original database, appending Test or a datetime to the name is what I usually do.

On my test server I need to untick the take tail-log backups option off the options screen before I can execute the restore.

Now you can either check the tick boxes in the restore plan section or (more fun) click the timeline button to select at what point in time you want to restore to.

![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2016/02/restore2.jpg?resize=768%2C457&ssl=1)

You can either select the point in time with your mouse or specify the exact point in the time textbox. Alternatively you can just select the most recent point, probably the most likely option when disaster strikes.

Now that I have tried doing this on my test server I feel much more confident that when disaster does strike I can get things restored quickly and painlessly.

## How often should you run transaction backups?

The answer to this question depends on how critical your data is. Until very recently I ran mine ever 15 minutes, I have increased this to every 5 minutes, but I have seen recommendations of running it [every minute](https://www.brentozar.com/archive/2014/02/back-transaction-logs-every-minute-yes-really/). The more critical your data the more often you should run them.
Businesswoman Tips
Tags: career
Published: 2016-02-04 04:08:02

---
title: Businesswoman Tips
published: true
tags: career
canonical_url: 
---

Occassionally, I’ll send out a Businesswoman Tip tweet that relates to a tough decision I had to make that day or a business tip I would like to share. This blog post is simply an aggregation of those posts in chronological order. Enjoy!

{% tweet 690917384790654976 %}

{% tweet 695095700548411396 %}

{% tweet 695386264866979840 %}
Replace git author using shell script
Tags: github, shellscript
Published: 2018-02-12 05:57:36

---
title: "Replace git author using shell script"
published: true
tags: github, shellscript
canonical_url: https://leonardofaria.net/2016/02/02/replace-git-author-using-shell-script/
---

This is an old trick that saved me several times. Sometimes people forget to setup their name and email information. The following script is useful to fix mistakes:

```
#!/bin/sh

git filter-branch -f --env-filter '

an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"

if ["$GIT_COMMITTER_EMAIL" = "old@email.com"]
then
  cn="New author name"
  cm="new@email.com"
fi

export GIT_AUTHOR_NAME="$an"
export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_NAME="$cn"
export GIT_COMMITTER_EMAIL="$cm"
'

echo "Run after"
echo "git push origin +master:master"
```
Happiness Retrospective
Tags: agile, retrospectives
Published: 2020-03-28 21:41:07

---
title: Happiness Retrospective
published: true
date: 2015-11-10 05:56:58 UTC
tags: Agile,Retrospectives
canonical_url: http://blog.boochtek.com/2015/11/09/happiness-retrospective
---

I facilitated a retrospective today; it was one of the best retros I’ve ever been involved with. I figured out what activities I wanted to do earlier in the morning. They were really quite simple. I wanted to focus on happiness.

## How happy are you at work?

I started with two questions that I’ve used with teams before, to some success (although not so successful for one particular team). The first question I asked was “How happy are you at work?” I had them put a rating from 0 to 10, with 0 meaning they should have quit last week, and 10 meaning they couldn’t imaging being happier at work.

The answers were mostly 7s and 8s, with a 5 and a 9. The average came to 7.5, which is pretty good. The 5 concerns me a bit, especially that it’s 2 points lower than anyone else’s answer.

## How effective do you think the teams is?

The next question I asked was “How effective do you think the teams is?”. Again, from 0 to 10, with 0 meaning they can’t accomplish anything, and 10 meaning you couldn’t imagine a more effective team.

When I ask both of these questions, the scores are always highly correlated. If your team isn’t doing good work, it’ll make you unhappy. And if you are unhappy, you’re less likely to do your best work. This team was no different; the 5 and 9 became a 6 and a 10, and most of the 7s became 8s, for an average of just under 8.

## What makes you happy at work?

The next question I asked was “What makes you happy at work?”. The answers were mostly about the teamwork and teammates. This went quicker than I expected. At this point, I was worried the retro would only last a little more than 30 minutes.

## What would make you happier at work?

The final question I asked was “What would make you happier at work?”. This was the real pay-off. We spent about half an hour just talking about the things that would make us happier, and what we could do to improve our happiness. We came up with 10 potential action items. I usually limit teams to trying 3 or 4 action items, but most of the items are quite small, so we’re going to try 6 of them. One is just observing another team’s standup meetings, to see how they’re using their time effectively.

Everyone went away feeling that this was a really good retro. It felt good to focus on happiness. Happiness is something I’ve been talking a lot about on the This Agile Life podcast, and it felt good to take some action on it. I’ve done “positive-only” retros before, but this one felt even better than that, by specifically targeting happiness and how we can achieve it.
Development Annoyance
Published: 2022-06-22 19:46:47

---
title: Development Annoyance
published: true
date: 2016-01-29 20:00:45 UTC
tags: 
canonical_url: https://www.funkysi1701.com/posts/2016/development-annoyance/
---

![](https://storageaccountblog9f5d.blob.core.windows.net/blazor/wp-content/uploads/2016/01/How-you-can-stop-annoyance-or-frustrations-quickly.jpg?w=425&ssl=1)

I spend a lot of my time creating new features that simplify my companies business processes.

A good example of this is an invoicing system I created. Instead of users working off different spreadsheets and copying and pasting data between various different programs the user can click a couple of buttons and everything is done and they can move on to the next task.

I am currently expanding this system so more of the companies work can be invoiced quickly and simply.

## I like working on this kind of problem.

I get to discuss with the different departments involved, finding out how they work and what could make their lives better.

I then get to look at what structures already exist in the database and get to rip out anything that makes no sense (Today I had a Customer table which has a primary key called ClientId – its now a Client table with PK ClientId) and add new structures to store new information.

I then can build a user interface so the users can interact with the data.

But the most important part of the process comes next. This is when I show the users what I have built and how it will make their lives better, they can then feed back to me questions and comments. How do I do x?, what about y?, have you thought about z?

After this very valuable feedback I can go back and tweak what I have done making it better and better until the users think it is suitable for what they need.

## Now why did I call this post development annoyance?

I find it intensely annoying that after spending weeks of my time working on creating something to be used. Users either make do with my solution and never tell me the one thing that really annoys them or worse they go back to the time consuming process and never feedback the one or two changes I need to make to complete the project.

Now I am not perfect, like many IT people my people skills are somewhat lacking but apart from asking people what can you do to get the feedback you need to complete the project?

I do not have the knowledge that other departments have so I consider development a team effort that requires everyone to contribute otherwise it will not finish.

The second outcome where users return to their old ways is the most annoying. It could well be months or even years before I find out that what I created is not being used any more. By that time my memory of what I did and more importantly why I did what I did has been lost and forgotten.

So users please, please tell me what works and what doesn’t and what things I can do to improve things. I want my solutions to constantly improve and get better and I can only do that with your help.
How to increase PHP memory_limit on CodeShip.io
Tags: experience, php
Published: 2024-03-16 10:08:02

---
title: How to increase PHP memory_limit on CodeShip.io
published: true
date: 2016-01-21 09:57:05 UTC
tags: Experience,PHP
canonical_url: https://io.serendipityhq.com/experience/how-to-increase-php-memory_limit-on-codeship-io/
---

Some days ago I found myself on front o f a problem: my unit tests failed because of lack of PHP memory.

This were the tedious error:

> PHP Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 16640 bytes)

As I use CodeShip.io as [continuous delivery server](http://aerendir.me/tag/continuous-delivery/), I had to increase the PHP `memory_limit` on their systems, but… how?

So I googled for a solution, but nothing helped me.

The last chance were to contact the support. As ever, the astonishing CodeShip.io’s support replied me with this email:

> PHP is limited to `256MB` memory by default on the build VMs (which you just barely exceeded it). But you have access to the `php.ini` and can configure the limit yourself. The file is located at
> 
> ```
> ${HOME}/.phpenv/versions/${YOUR_PHP_VERSION}/etc/php.ini
> ```
> 
> and e.g. the following sed call would achieve increasing the limit
> 
> ```
> sed -i'' 's/^memory_limit=.*/memory_limit = 512m/g' .phpenv/versions/5.6/etc/php.ini
> ```
> <footer><cite title="CodeShip support">CodeShip support</cite></footer>

So, a simple line in my setup commands, increased the default php `memory_limit`:

```
sed -i'' 's/^memory_limit=.*/memory_limit = 512m/g' ${HOME}/.phpenv/versions/5.6/etc/php.ini
```

Remember to “Make. Ideas. Happen.”.

I wish you flocking users, see you soon!

L'articolo [How to increase PHP memory\_limit on CodeShip.io](https://io.serendipityhq.com/experience/how-to-increase-php-memory_limit-on-codeship-io/) proviene da [ÐΞV Experiences by Serendipity HQ](https://io.serendipityhq.com).
Tuple, a new data structure in C#
Tags: aspnet, csharp
Published: 2018-02-10 22:31:38

---
title: "Tuple, a new data structure in C#"
published: true
tags: ASP.NET,CSharp,asp.net
canonical_url: http://blog.mandarbadve.com/2016/01/20/tuple-a-new-data-structure-in-c/
---


_This post was originally published on [blog.mandarbadve.com](http://blog.mandarbadve.com/2016/01/20/tuple-a-new-data-structure-in-c/)_

Tuple is an interesting data structure in C#. It contains&nbsp;number and sequence. You can create tuple of 1 to 7&nbsp;elements. Additionally you can create tuple of eight element using the TRest element. TRest element allows you to add nested tuple.

Let see example of basic tuple. We have student entity having marks fro seven subject. We can define this data structure by using tuple.

```
var tupleStudent = Tuple.Create("Mandar Badve", 87, 45, 76, 78, 64, 71, 80);
Console.WriteLine(""+ tupleStudent.Item1 + " got " + tupleStudent.Item2 + " marks in first subject.");
//// OUTPUT: MandarÂ BadveÂ gotÂ 87Â marksÂ inÂ firstÂ subject.
Console.WriteLine(""+ tupleStudent.Item1 + " got " + tupleStudent.Rest.Item1 + " marks in seventh subject.");
//// OUTPUT: Mandar Badve got 80 marks in seventh subject.
```

In above example first console will print the name of student accessed using Item1 of tuple and marks got in first subject accessed using Item2 of tuple.&nbsp;In second console we have access nested tuple using Rest property of tuple.

### You can create tuple by using two ways.

- 
 Using constructor

```
var tupleUsingConstructor = new Tuple<string, int, int, int, int, int, int>("Mandar Badve", 87, 45, 76, 78, 64, 71);
```

- 
 Using helper method Create()

```
var tupleByHelperMethod = Tuple.Create("Mandar Badve", 87, 45, 76, 78, 64, 71, 80);
```

### Create method have different overloads as follows:

| 
##### Name
 | 
##### Description
 |
| Create\<T1\>(T1) | Creates a 1-tuple, or singleton |
| Create\<T1,â€‚T2\>(T1,â€‚T2) | Creates a 2-tuple, or pair. |
| Create\<T1,â€‚T2,â€‚T3\>(T1,â€‚T2,â€‚T3) | Creates a 3-tuple, or triple. |
| Create\<T1,â€‚T2,â€‚T3,â€‚T4\>(T1,â€‚T2,â€‚T3,â€‚T4) | Creates a 4-tuple, or quadruple. |
| Create\<T1,â€‚T2,â€‚T3,â€‚T4,â€‚T5\>(T1,â€‚T2,â€‚T3,â€‚T4,â€‚T5) | Creates a 5-tuple, or quintuple. |
| Create\<T1,â€‚T2,â€‚T3,â€‚T4,â€‚T5,â€‚T6\>(T1,â€‚T2,â€‚T3,â€‚T4,â€‚T5,â€‚T6) | Creates a 6-tuple, or sextuple. |
| Create\<T1,â€‚T2,â€‚T3,â€‚T4,â€‚T5,â€‚T6,â€‚T7\>(T1,â€‚T2,â€‚T3,â€‚T4,â€‚T5,â€‚T6,â€‚T7) | Creates a 7-tuple, or septuple. |
| Create\<T1,â€‚T2,â€‚T3,â€‚T4,â€‚T5,â€‚T6,â€‚T7,â€‚T8\>(T1,â€‚T2,â€‚T3,â€‚T4,â€‚T5,â€‚T6,â€‚T7,â€‚T8) | Creates a 8-tuple, or octuple. |
Refactorizando código
Tags: spanish, development, refactoring
Published: 2022-03-28 17:07:04

---
title: Refactorizando código
published: true
date: 2016-01-14 18:53:32 UTC
tags: spanish,development,refactoring
---

14 January 2016

> “La verdad siempre se halla en la simplicidad y no en la multiplicidad y confusión de las cosas”. Isaac Newton

Luego de mi post anterior ([Escribe Código Limpio sin morir en el intento](https://codedebug.co/blog/2016/01/08/escribe-codigo-limpio-sin-morir-en-el-intento/)) seguimos con esta serie de post sobre ‘codear’ correctamente, esta vez veremos **refactorización**.

### Que es refactorizar?

![](https://cdn-images-1.medium.com/max/636/0*552k49Iz5hDKl7aS.gif)

La definición de [Microsoft](https://msdn.microsoft.com/es-es/library/719exd8s.aspx) es:

> _“La refactorización es el proceso que consiste en mejorar el código una vez escrito cambiando su estructura interna sin modificar su comportamiento externo.” No creo que esto merezca mayor explicación, ahora veamos sus particularidades:_

### No arregla errores ni añade funcionalidades

![](https://cdn-images-1.medium.com/max/960/0*WE24OIAt30Rk3qYJ.gif)

El objetivo de la refactorización es mejorar la comprensión del código o cambiar su estructura y diseño y eliminar código innecesario, por lo tanto deberíamos refactorizar antes de hacer mantenimiento al proyecto o agregar nuevas funcionalidades.

### Desarrolla basado en Pruebas (TDD)

![](https://cdn-images-1.medium.com/max/500/0*BTjob4GldA8NRfPJ.gif)

La mayoría de lenguajes de programación modernos tienen suites para realizar **Pruebas Unitarias** (es una forma de probar el correcto funcionamiento de un módulo de código) con ello logramos comprobar de ‘mejor’ manera los cambios realizados y cuanto afecta el correcto funcionamiento del desarrollo.

### Como funciona?

![](https://cdn-images-1.medium.com/max/372/0*6CGboz0EEzs2T8Uk.gif)

Pasemos de la teoría a la práctica, tenemos un método llamado _get\_first\_element_ que recibe una variable, determina si es _array_ y retorna el primer elemento, de lo contrario retorna _false_:

{% gist https://gist.github.com/emamut/9e2f86f5c151913aecee %}

Al refactorizar quedaria asi:

{% gist https://gist.github.com/emamut/b0d8811674216b0c8fce %}

### En conclusión

![](https://cdn-images-1.medium.com/max/500/0*ZjIgk1dxyiPJKmmz.gif)

El refactorizar exige un poderoso conocimiento del lenguaje en que se realice, debería reducir el número de líneas y así mejorar la comprensión.

_Publicado originalmente el 14 de enero de 2016 en codedebug.co._
Angular Roster Tutorial
Tags: engineering, angular, playersarray, array
Published: 2020-10-01 06:20:10

---
title: Angular Roster Tutorial
published: true
date: 2016-01-12 00:00:00 UTC
tags: Engineering,AngularJS,PlayersArray,Array
canonical_url: https://www.loginradius.com/engineering/blog/angular-roster-tutorial/
---

If you're not familiar with Angular I'd highly recommend heading over to the Angular JS resource site and checking out what all the fuss is about. Once you've got a basic understanding of Angular and how to get it up and running this tutorial will show you some of the basic, but…

   
[Read On](https://www.loginradius.com/engineering/blog/angular-roster-tutorial/)
iOS Project Structure
Published: 2020-09-16 01:31:26

---
title: iOS Project Structure
published: true
date: 2016-01-11 00:00:00 UTC
tags: 
canonical_url: https://luisramos.dev/ios-project-structure
---

To better organized my code, I have been changing my project structure along the years. I think I've finally set with one, so time to record it for the future!

There are two basic guidelines when creating a project structure. First, keep it simple. Second, use something that makes sense to you.

If you google a bit for this topic you may find this quora [answer](https://www.quora.com/How-should-I-structure-my-iOS-app) or these [guidelines](https://github.com/futurice/ios-good-practices#project-structure). They both suggest something like this:

- View Controllers
- Views
- View Models
- UI (aka storyboards)

If you have small projects, this structure will work fine. But when you start adding more files to it it becomes confusing. I rather organize files in a functional way, separating them by areas and layers of the app. So it ends up something more like this:

- 

Interface

  - Base
  - Onboarding
  - Feed
  - User
  - Settings
- Networking
- Local Storage
- 

Classes

  - Categories/Extensions
  - Classes that don't fit anywhere else
- Resources

Inside those folders I usually follow the first setup, separating files by Views, ViewControllers, etc. This way you have almost every file related to an area of the app in one folder. All my images are stored in XCAssets. Fonts and other raw files are in Resources (usually with a dedicated folder for each).

If you have an even awesome setup or if you just want to share yours, feel free to [send me a tweet](https://twitter.com/luisramos1337).
Escribe código limpio sin morir en el intento
Tags: spanish, clean, code, coding
Published: 2022-03-28 17:07:56

---
title: Escribe código limpio sin morir en el intento
published: true
date: 2016-01-08 05:27:00 UTC
tags: spanish,clean,code,coding
canonical_url: 
---

> _Gastamos la mayor parte del tiempo leyendo código_

![](https://cdn-images-1.medium.com/max/500/0*7dKkLTBVOQVnnGSg.gif)

Si lees este articulo es porque probablemente eres Desarrollador, Diseñador o curioso y te has encontrado con código de otras personas donde no entiendes como rayos lo hicieron o para donde quieren ir… pero funciona.

Muchos dirán: _“No hay problema… mientras funcione… no pasa nada”, “Que quiere: Que escriba rápido o bonito?”_ o _“Pareces un viejito temático!”_ pero el asunto no es ese, veamos…

### El código no es tuyo

![](https://cdn-images-1.medium.com/max/350/0*Xx9Wv3BHh8_fupht.gif)

Aunque sea un desarrollo privado y/o solo sea realizado por ti, nada garantiza que no será mantenido por otro(s) desarrollador(es), no permitas que otros insulten a tu santa madrecita cuando vean el estropicio que hiciste.

Tu código debe leerse como una poesía, por lo menos debes identar correctamente y mantener un cierto orden entre los fragmentos de tu lógica.

Por ejemplo este tipo quiere que le revisemos este código:

{% gist https://gist.github.com/emamut/e4409a0106737ac7ff1f %}

A diferencia de este donde solo se idento, se pusieron unos espacios para mejorar y se eliminaron unas llaves que estaban de más:

{% gist https://gist.github.com/emamut/592ce9375b0f692dd645 %}

Aunque este ejemplo es sumamente básico imagínate trabajando en una clase con varios métodos donde la lectura del código se haga tediosa.

### No impongas, concerta

![](https://cdn-images-1.medium.com/max/400/0*UA5NW1O_cM1TZZKF.gif)

Los estilos y patrones deben ser definidos por el equipo, no por el líder del mismo, cada miembro debe participar y aportar en este proceso. Esto da sentido de pertenencia y apropiación de las decisiones que se tomen.

Pero si trabajas solo debes mantener tu estilo y ser consistente para definir tu sello, tu marca.

### Lee y sigue a los mejores

![](https://cdn-images-1.medium.com/max/500/0*1f29d8KpRMKHqO6N.gif)

Mi primer acercamiento al concepto de Código Limpio fue con unos programadores españoles de primerísimo nivel con quienes tuve el honor de laborar, ademas de consumir literatura como [Código Limpio: Manual de estilo para el desarrollo ágil de software](http://www.amazon.es/C%C3%B3digo-Limpio-desarrollo-software-Programaci%C3%B3n/dp/8441532109)de [Robert C. Martin](https://en.wikipedia.org/wiki/Robert_Cecil_Martin) un libro super recomendado.

No olvides que el tiempo es dinero y si logras ahorrar tendrás mejores ganancias. Si tienes algun link o libro que conozcas compártelo en los comentarios.

_Publicado originalmente el 8 de enero de 2016 en codedebug.co._
How to Promise
Tags: javascript, promise
Published: 2020-10-01 06:20:23

---
title: How to Promise
published: true
date: 2016-01-05 00:00:00 UTC
tags: JavaScript,Promise
canonical_url: https://www.loginradius.com/engineering/blog/how-to-promise/
---

As a front-end developer, if you haven't heard about Promise in Javascript, well ... At least you have heard about it now! And it is truly amazing. Promise is a the standard way of handling asynchronous operations, such as calling APIs. It is comprehensive but elegant, espeically…

   
[Read On](https://www.loginradius.com/engineering/blog/how-to-promise/)