Skip to content

Instantly share code, notes, and snippets.

View txomon's full-sized avatar

Javier Domingo Cansino txomon

  • Germany/Koln, UK/London, Spain/Bilbao
View GitHub Profile
@txomon
txomon / beta-script for large files
Created January 1, 2011 23:09
Script for listing the 10 biggest files in the package pass as argument
echo
ultimos_10=`git verify-pack -v $1 | sort -nk3 | tail `
shadelos10=`echo $ultimos_10| xargs -n1 | awk -F\ '{ if (length($1) > 30) print $1}'`
for a in $shadelos10 ; do
hashynombre=`git rev-list --objects --all | grep $a`
tamano=`git verify-pack -v $1 | grep $a | tail | awk -F\ '{print $3}'`
echo $hashynombre
echo "File size(s): $tamano";
done
def _operations_list_to_string(self,operations):
""" (list | str) -> str
The function returns a plain string of the inner lists
>>> _operations_list_to_string(['a','+',[['b','+','d'],'*','c']])
'(a+((b+d)*c))'
"""
if type(operations) == list:
result = '('
for operation in operations:
@txomon
txomon / gitolite.conf
Last active December 12, 2015 06:49
gitolite.conf real example
################################################
# Creamos los grupos de personas. Empiezan por p.
# ej: p-grupo1
################################################
@p-adviser = dani borja
@p-ksensor = javier dani borja
@p-hardware = ainhoa adrian
@p-sensor = @p-ksensor @p-hardware
@p-nqas = @p-sensor # @p-qosmeter
git push git@localhost:javier/kernel javier-master-dev
Initialized empty Git repository in /home/git/repositories/javier/kernel.git/
fatal: bad git namespace path "*/kernel"
fatal: The remote end hung up unexpectedly
@txomon
txomon / base.py
Last active December 20, 2015 16:39
When a track is skipped some services want to know about that (i.e. Grooveshark, rdio) to report the usage rate.
class TracklistProvider(object):
def get_random(self):
pass
def set_random(self):
pass
def get_repeat(self):
pass
def get_consume(self):
pass
def set_consume(self):
....................................EEEEEEEE..EEEEE.E...EEEEEE...EE..EEEEE.E...EEEE.EE.EEE.EEEEEEEEEEEEEE..EE.EE.E.EEEEEE..EEE.EEE.EEE.EEE..EEEEEEEE.EE..............................E....E........EE.....................................................................................................................................................................................................................................................................................E.......E....................E................................................................................................................................................F.......F.......EEE.............................................EE..E..............................................................EEEEEEE........................................EE.EE....................................FEEE.................FEFFF....F..............................................................................................................................
@txomon
txomon / .bash_aliases
Last active December 28, 2015 23:58
Activator for python environment
alias activate="source activate_environment"
@txomon
txomon / gist:7790718
Created December 4, 2013 16:34
Xilinx backtrace
*** glibc detected *** /opt/Xilinx/14.1/ISE_DS/ISE/bin/lin64/unwrapped/trce: double free or corruption (!prev): 0x0000000002194bd0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x76d76)[0x2b38c0444d76]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x6c)[0x2b38c0449aac]
/opt/Xilinx/14.1/ISE_DS/ISE//lib/lin64/libxalanc.so(_ZN11xalanc_1_1014XSLTEngineImpl9terminateEv+0x348)[0x2b38c5bf1908]
/opt/Xilinx/14.1/ISE_DS/ISE//lib/lin64/libxalanc.so(_ZN11xalanc_1_108XSLTInit9terminateEv+0xe)[0x2b38c5bfa37e]
/opt/Xilinx/14.1/ISE_DS/ISE//lib/lin64/libxalanc.so(_ZN11xalanc_1_108XSLTInitD1Ev+0x23)[0x2b38c5bfa3f3]
/opt/Xilinx/14.1/ISE_DS/ISE//lib/lin64/libxalanc.so(_ZN11xalanc_1_1016XalanTransformer9terminateEv+0x65)[0x2b38c5c951e5]
/opt/Xilinx/14.1/ISE_DS/ISE//lib/lin64/libTw.so(+0x1bc3bf)[0x2b38c18903bf]
/opt/Xilinx/14.1/ISE_DS/ISE//lib/lin64/libTw.so(+0xe8a22)[0x2b38c17bca22]
@txomon
txomon / C-kernel-codestyle-eclipse.xml
Created January 13, 2014 10:01
This is a configuration file for eclipse to make C code follow as much as possible Linux Codystyle
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="1">
<profile kind="CodeFormatterProfile" name="Linux Kernel" version="1">
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
<setting id="org.eclipse.cdt.core.formatter.lineSplit" value="80"/>
<setting id="org.eclipse.cdt.core.formatter.alignment_for_member_access" value="0"/>
<setting id="org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types" value="do not insert"/>
<setting id="org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
@txomon
txomon / constantes.h
Created February 19, 2014 14:12
Ejercicio 6
#ifndef __constantes_h__
#define __constantes_h__
unsigned int captura[128][4]={
{32547, 43087, 39473, 40464},
{32958, 44850, 57522, 38053},
{12381, 38274, 43769, 17835},
{7621, 25373, 6670, 6855},
{53383, 31948, 25651, 43828},
{56839, 64784, 58918, 46176},