View run_opencover.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function | |
import os | |
import sys | |
import fnmatch | |
from subprocess import Popen |
View cont_test.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
_CURRENT_HASH="_new_stat.bak" | |
_PREVIOUS_HASH="_old_stat.bak" | |
_ANY_HASH="_???_stat.bak" | |
function pause() { | |
local key | |
read -t$1 -N1 -p"$2" key | |
case "$key" in |
View clabe.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from itertools import cycle, izip | |
def digver(clabe): | |
mult = cycle((3,7,1)) | |
cta = (int(c) for c in clabe) | |
res = ((a * b) % 10 for (a, b) in izip(mult, cta)) | |
return 10 - (sum(res) % 10) |
View DataReaderExtensions.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ACV.Common.DB | |
{ | |
using System; | |
using System.Collections.Generic; | |
using System.Data; | |
using System.Data.Common; | |
public static class SqlExtensions | |
{ | |
private static object GetOrDefault(this IDataRecord record, string columnName, object @default = null) |
View IterTools.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
View bash_rc.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} |
View apply_version_deltas.bat
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ( |
View wordwrap.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import unittest | |
def wrap(s, w): | |
def split(s, at, gap=0): | |
return s[:at] + '\n' + wrap(s[at + gap:], w) |
View finddup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import os | |
from os import path | |
from itertools import imap, chain | |
import fnmatch | |
# Set the base path to scan for duplicates here | |
base = r'/media/file-rep/files' |
View spwho_loop.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @table TABLE | |
( | |
SPID INT | |
,Status VARCHAR(15) | |
,[Login] VARCHAR(30) | |
,HostName VARCHAR(MAX) | |
,BlkBy VARCHAR(10) | |
,DBName VARCHAR(15) | |
,Command VARCHAR(MAX) | |
,CPUTime INT |
NewerOlder