Skip to content

Instantly share code, notes, and snippets.

View andresmoschini's full-sized avatar

Andres Moschini andresmoschini

  • Making Sense
  • Mar del Plata
View GitHub Profile
@andresmoschini
andresmoschini / PullRequestsMergining.md
Last active August 29, 2015 14:21
Altenativas para mergear Pull Requests

Altenativas para mergear Pull Requests

Dueño del repositorio hace los merges

Pros

  • Control total sobre que se mergea.
  • El dueño del repo es el único responsable del código.

Cons

@andresmoschini
andresmoschini / git-bisect-applied.md
Last active September 6, 2019 13:54
Aplicando Git Bisect

Aplicando Git Bisect

Desde hace tiempo, cuando recién estaba investigando qué era Git, me llamo la atención el comando git bisect, pero siempre imaginé que sería dificil de aplicar y nunca se me ocurrió probarlo, hasta ahora.

El escenario

Trabajé en un feature branch, hice el Pull Request y recién luego (mal por mi) ejecuté los tests, que lamentablemente fallaron.

Los tests los corro con el siguiente comando:

@andresmoschini
andresmoschini / Maybe.cs
Last active August 29, 2015 14:26
Maybe Monad C# implementation
using System;
using System.Collections;
using System.Collections.Generic;
namespace Utilities
{
public static class Maybe
{
public static Maybe<T> From<T>(T value) => new Maybe<T>(value);
public static Maybe<T> None<T>() => default(Maybe<T>);
{
"$schema": "http://json-schema.org/draft-04/schema",
"id": "campaign-social-preferences.json",
"type": "object",
"properties": {
"shareButtons": {
"type": [ "array", "null" ],
"items": {
"type": "string",
"enum": [
@andresmoschini
andresmoschini / TemplateCtrl.js
Last active February 18, 2016 15:31
Plantillas para controllers y services en Relay
(function () {
'use strict';
angular
.module('dopplerRelay')
.controller('TemplateCtrl', TemplateCtrl);
TemplateCtrl.$inject = [
'$scope',
'templates',
(function () {
'use strict';
angular
.module('dopplerRelay')
.directive('validationErrors', validationErrors);
validationErrors.$inject = [
"$compile"
];
@andresmoschini
andresmoschini / P4Merge and Git Extensions.md
Last active November 9, 2022 20:16
P4Merge and Git Extensions
  1. Download and install p4Merge (Helix P4Merge: Visual Merge Tool) from Perforce page
  2. Configure Git Extensions (Tools / Settings / Git Config) with the follow values (see image):
    • Mergetool: p4merge
    • Path to mergetool: C:/Program Files/Perforce/p4merge.exe
    • Mergetool command: "C:/Program Files/Perforce/p4merge.exe" "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
    • Difftool: p4merge
    • Path to difftool: C:/Program Files/Perforce/p4merge.exe
  • Difftool command: "C:/Program Files/Perforce/p4merge.exe" "$LOCAL" "$REMOTE"
@andresmoschini
andresmoschini / client.cs
Created June 23, 2017 19:29
Test Async/Await benefits
using System;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Threading.Tasks;
namespace Client
{
class Program
{
@andresmoschini
andresmoschini / EmailUrlObfuscation.cs
Last active September 12, 2017 13:56
EmailUrlObfuscation
using System;
using System.Text;
using System.Linq;
public static class EmailUrlObfuscation
{
private static string AtSymbolEncode(this string email) => email
.Replace("]", "-]")
.Replace("@", "[a]");
/*
EXAMPLE EXECUTION
testname: GetNeverPonyNumber
uniques: 50000000
collisions: 0
examples: 8702a199572565e1, 84a4a866d8222e3f, 7de9de6bc852e14d
elapsed: 00:03:47.0953452