Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@felipem775
felipem775 / non-ascii.sh
Created September 25, 2019 07:28
Busca caracteres fuera del ascii
# Busca caracteres fuera del ascii
find -name '*.py' -print0 |xargs -0 grep -P '[^\x00-\x7f]' > /tmp/non-ascii.txt
@felipem775
felipem775 / settings.json
Created September 2, 2019 11:48
Settings para que VSCode muestre los test de python con la posibilidad de ejecutar en debug
{
"python.pythonPath": "env/bin/python",
"pythonTestExplorer.testFramework": "unittest",
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
],
@felipem775
felipem775 / goreviewpartner config.ini
Created August 3, 2019 11:15
goreviewpartner config
[General]
language = en
sgffolder = /tmp
rsgffolder =
pngfolder =
livefolder = live_analysis
stonesound =
[Analysis]
maxvariations = 26
from datetime import datetime
import matplotlib.pyplot as plt
fn = "Nivel_Cares_1.csv"
X, Y = [], []
with open(fn) as f:
f.readline() # leer y descartar cabecero
for line in f:
y, x = line.strip().replace(",",".").split(";")
@felipem775
felipem775 / untarFiles.sh
Created October 17, 2018 20:15
untar files in a different path
for filename in *.tar; do
tar -xf "$filename" -C "destino"
done
@felipem775
felipem775 / createFolders.sh
Last active September 12, 2018 00:22
tinymp4 adventure time && archer renamer
#!/bin/bash
BASEDIR="$PWD/.."
for f in "$BASEDIR"/*.mp4
do
fbname=$(basename "$f" .mp4)
SEASON=${fbname:0:2}
FOLDER=$SEASON
if [ "$FOLDER" -eq "00" ];then FOLDER="Extras";fi
EPISODE=${fbname:3:2}
NAME=${fbname:7}
@felipem775
felipem775 / findMaxValue.js
Created July 31, 2018 10:59
Find the object whose property "X" has the greatest value in an array of objects
// https://stackoverflow.com/questions/4020796/finding-the-max-value-of-an-attribute-in-an-array-of-objects Andy Polhill
var n1 = { dateTime: new Date(), name: "n1"}
var n2 = { dateTime: new Date(), name: "n2"}
data = [n1, n2]
data.reduce(function (prev, current) { return (prev.dateTime > current.dateTime) ? prev : current })
@felipem775
felipem775 / png2mp4
Created June 6, 2018 07:11
convertir imágenes png a vídeo
ffmpeg -framerate 10 -pattern_type glob -i '*.png' -c:v libx264 \
-r 30 -pix_fmt yuv420p out.mp4