Skip to content

Instantly share code, notes, and snippets.

View asierba's full-sized avatar

Asier Barrenetxea asierba

View GitHub Profile

Programming skills

Read them in this order

Agile & others

@asierba
asierba / fizzbuzz.cob
Created June 8, 2018 22:04
Fizzbuz in cobol
PROGRAM-ID. FIZZBUZZ.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 BY-3 PIC 9(1).
01 BY-5 PIC 9(1).
01 C PIC 9(2).
01 I PIC 9(3) VALUE 1.
PROCEDURE DIVISION.
PERFORM FIZZBUZZ-OF VARYING I FROM 1 BY 1 UNTIL I=100
STOP RUN.
@asierba
asierba / flatten.js
Created May 21, 2018 11:12
function that flattens an array in javascript
function flatten(items) {
return items.reduce((result, current) => {
if (current.constructor === Array)
return result.concat(flatten(current))
return result.concat(current);
}, []);
}

List of possible constraints for a kata

  • No constraints
  • Small methods: 4 lines each
  • No if statements
  • No primitives
  • No loops
  • Baby steps
  • Change approach, if you're doing bottom-up (Cell class first),try top-down (Board class first)

Global Day Code Retreat Facilitaor training

  • Code retreat structure to follow:
    • 6 sessions
    • 45 mins coding + 5 min retro
    • Final retro at the end
  • Introduction:
    • Open question: "What is good code? " -> quick discussion, people will end up mentioning 4 rules of sinle design
    • mention 4 rules of simple design
fibo 0 = 0
fibo 1 = 1
fibo x = fibo(x-1) + fibo(x-2)
allFibos 0 = [fibo 0]
allFibos x = allFibos(x-1) ++ [fibo x]
fibo :: Int -> Int
Mentoring [Find mentors]
=========
Format
-------
- Set goal - define successful mentorship
- Set frenquency and duration
- Set Clear deadline?
- Set Milestones
- Mentee to set agenda before each meeting
@asierba
asierba / unittestconsole.cs
Last active January 19, 2024 11:12
How to mock console in unit tests
class Program
{
public static void Main(string[] args)
{
Console.WriteLine("What's your name?");
var name = Console.ReadLine();
Console.WriteLine(string.Format("Hello {0}!!", name));
}
[Test]
@asierba
asierba / Autofixture.cs
Last active August 29, 2015 14:24
Two xunit tests to show how Automocking can be achieved with AutoFixture
using Moq;
using Ploeh.AutoFixture;
using Ploeh.AutoFixture.AutoMoq;
using Xunit;
namespace Autofixture
{
public class Tests
{
alias gs='git status '
alias ga='git add '
alias gb='git branch '
alias gc='git commit'
alias gd='git diff'
alias go='git checkout '
alias gk='gitk --all&'
alias gx='gitx --all'
alias gitext='gitextensions &'