Skip to content

Instantly share code, notes, and snippets.

call :release_delta
:: por cada version
for %%v in (105 103 201) do (
:: por cada release
for /D %%a in (C:\ruta_releases\50%%v.0300.*) do (
:: por cada build
for /D %%b in ("%%a\build-50%%v.0300.*") do (
:: aplicar el delta de version
for %%f in ("%%b\BD\650000000000*.sql") do (
@yngwie74
yngwie74 / bash_rc.sh
Last active August 29, 2015 14:05
Run a specific command for each file in the current repository with a given status
# usage: foreach "modified" "git restore"
# restores all the currently modified files, leaving others (deleted, renamed) alone
function foreach {
local status=$1
local action=$2
git status | awk '/'"$status"':/{print "'"$action"' \""$3"\""}' | bash
}
@yngwie74
yngwie74 / IterTools.cs
Created May 18, 2015 22:45
Miscellaneous helper functions to work with Enumerations
public static class IterTools
{
private static readonly Random Random = new Random();
/// <summary>
/// Make an enumeration with a single element.
/// </summary>
/// <typeparam name="T">The type of the enumeration elements.</typeparam>
/// <param name="element">The single element to enumerate.</param>
/// <returns>A reference to the enumeration.</returns>
@yngwie74
yngwie74 / roman_dict.py
Created January 17, 2012 00:45
Mi implementación original de la kata "Roman Numerals".
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Implementación de la kata "Roman Numerals" (http://bit.ly/92cEtq).
Esta implementación mapea directamente cada dígito arábigo a su
representación romana. Mientras que es la versión más pequeña y
clara que he hecho, de alguna forma "feels like cheating".
"""
@yngwie74
yngwie74 / find_primes.py
Created January 17, 2012 00:12
Mi implementación del problema #7 del proyecto Euler
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Implementación del problema #7 del proyecto Euler (projecteuler.net/problem=7):
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that
the 6th prime is 13. What is the 10,001st prime number?
https://gist.github.com/1623748
"""
@yngwie74
yngwie74 / find_primes_tests.py
Created January 17, 2012 00:13
Pruebas unitarias para find_primes.py (https://gist.github.com/1623748)
#!/usr/bin/python
# -*- coding: utf-8 -*-
from itertools import izip
from unittest import main, TestCase
from find_primes import allPrimes, isPrime, findNthPrime
class TestPrimes(TestCase):
def verifyIsPrime(self, number, outcome):
@yngwie74
yngwie74 / roman.py
Created January 17, 2012 00:36
Implementación "literaria" de la kata "Roman Numerals". La versión sin refactorizar en gist.github.com/1623830
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Implementación de la kata "Roman Numerals" (http://bit.ly/92cEtq).
Esta es una implementación "literal" de las reglas de la numeración romana.
Fue escrita con el propósito específico de *NO* usar un diccionario en la
conversión.
@yngwie74
yngwie74 / roman_single_func.py
Created January 17, 2012 00:41
Mi implementación de la kata "Roman Numerals" en una sola función.
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Implementación de la kata "Roman Numerals" (http://bit.ly/92cEtq).
Esta es una implementación "literal" de las reglas de la numeración romana.
Fue escrita con el propósito específico de *NO* usar un diccionario en la
conversión.
"""
@yngwie74
yngwie74 / roman_tests.py
Created January 17, 2012 01:13
Pruebas unitarias para la roman.py y sus variaciones
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Pruebas unitarias para
- roman.py (https://gist.github.com/1623819),
- roman_single_func.py (https://gist.github.com/1623830), y
- roman_func.py (https://gist.github.com/1885963)
- roman_dict.py (https://gist.github.com/1623854)
@yngwie74
yngwie74 / euler07.htm
Created February 1, 2012 01:00
"Runner page" para las pruebas del problema 7 del Projecto Euler
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<!-- this file: https://gist.github.com/1714293 -->
<title>Project Euler - Problem 7</title>
<link rel="shortcut icon" type="image/png" href="jasmine/jasmine_favicon.png">
<link rel="stylesheet" type="text/css" href="jasmine/jasmine.css">
<script type="text/javascript" src="jasmine/jasmine.js"></script>