Skip to content

Instantly share code, notes, and snippets.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/*
* Snippet para la conversión de fechas en tipo String a DateTime
* 31/08/2015, Francisco Pérez, [email protected]
*/
# Snippet para calcular fechas aleatorias en un periodo definido por los parametros StartDate y EndDate
# 07/09/2015
# Francisco Pérez, [email protected]
import datetime
import random
#Comienzo del periodo el 01/01/2015 a las 0:00
sDate = datetime.datetime(2014,1,1,0,0)
#Fin del periodo el 31/12/2015 a las 23:59
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/*
* 28/09/2015, Calculo de en milisegundos entre la fecha actual y 1970/01/01
* Francisco Pérez, [email protected]
*/
@fcojperez
fcojperez / CassandraGettingStarted.cs
Created September 30, 2015 07:54
A proof of concept about how to connect to Cassandra with C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Cassandra;
/*
* 30/09/2015
*
@fcojperez
fcojperez / ConvertDateToEpoch.cs
Created November 3, 2015 12:23
C# how to convert Date to Epoch
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConvertDateTimeEpoch
{
class ConvertDateToEpoch
{
static void Main(string[] args)
CREATE PROCEDURE getFreeSpaceDrive
@drive varchar(1),
@MB_Free INT OUTPUT
AS
BEGIN
/*
* PROCEDURE FOR GETTING FREE SPACE IN A DRIVE @drive
* RETURN @MB_Free
* FOR TESTING PROCEDURE EXECUTE THESE LINES
* DECLARE @MB INT = 0;
namespace Utilites
{
/// <summary>
/// Basic Logging class for tracking execution programas
/// </summary>
/// <remarks>
/// Developer: Francisco Perez
/// Mail: [email protected]
/// Date: 29/12/2016
/// </remarks>
/*
* Función para Imprimir título en Qlickvies scripts
* 24/01/2017, Francisco Perez, [email protected]
*/
sub TitleTrace(title)
LET vTitle.len = len(title);
LET vLine1 = Repeat('*', $(vTitle.len) + 4);
TRACE $(vLine1);
#!/bin/python3
'''
Given an array of integers, calculate which fraction of its elements are positive, which fraction of its elements are negative, and which fraction of its elements are zeroes, respectively. Print the decimal value of each fraction on a new line.
Note: This challenge introduces precision problems. The test cases are scaled to six decimal places, though answers with absolute error of up to are acceptable.
https://www.hackerrank.com/challenges/plus-minus
'''
import sys
@fcojperez
fcojperez / stopScreenSaver.vbs
Created September 15, 2017 12:34
A visual basic script for stopping screen saver because you cannot manage screen saver options due a Directory Active policy
'***********************************************************
'Script for sending inputs and avoiding start screen saver
'***********************************************************
'Developer: Francisco Perez
'mail: [email protected]
'Date: 9/13/2017 (MM/DD/YYYY)
Option Explicit
Dim finishTime