Skip to content

Instantly share code, notes, and snippets.

View albarralnunez's full-sized avatar
😄
Coding

Daniel Albarral Nuñez albarralnunez

😄
Coding
  • SF
View GitHub Profile
@albarralnunez
albarralnunez / counting_inner_calls.py
Created September 25, 2017 18:21
Counting inner calls in an unknown function, incorrect code demonstration
import sys
global_counter = 0
def count_calls(func, *args, **kwargs):
"""Count calls in function func"""
calls = [ -1 ]
def tracer(frame, event, arg):
global global_counter
@albarralnunez
albarralnunez / test_speed_mxdiflg.py
Created August 22, 2017 10:13
test_speed_mxdiflg.py
import time
def mxdiflg1(a1, a2):
if a1 and a2:
return max(
len(max(a1, key=len)) - len(min(a2, key=len)),
len(max(a2, key=len)) - len(min(a1, key=len)))
return -1
function TestPort
{
Param(
[parameter(ParameterSetName='ComputerName', Position=0)]
[string]
$ComputerName,
[parameter(ParameterSetName='IP', Position=0)]
[System.Net.IPAddress]
$IPAddress,
@albarralnunez
albarralnunez / default.sublime-project
Last active December 17, 2015 14:29
ST2 - Default *.sublime-project
{
"folders":
[
{
"path": "",
"folder_exclude_patterns":
[
"Img"
],
@albarralnunez
albarralnunez / Makefile.cmd
Last active December 17, 2015 14:28
LaTeX - Makefile PDF
pdflatex main.tex
pause
@albarralnunez
albarralnunez / main.tex
Last active June 3, 2022 10:43
LaTeX - Template for presentation
% Copyright 2004 by Till Tantau <tantau@users.sourceforge.net>.
%
% In principle, this file can be redistributed and/or modified under
% the terms of the GNU Public License, version 2.
%
% However, this file is supposed to be a template to be modified
% for your own needs. For this reason, if you use this file as a
% template and not specifically distribute it as part of a another
% package/program, I grant the extra permission to freely copy and
% modify this file as you see fit and even to delete this copyright