Skip to content

Instantly share code, notes, and snippets.

Felipe Maza felipem775

Block or report user

Report or block felipem775

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@felipem775
felipem775 / non-ascii.sh
Created Sep 25, 2019
Busca caracteres fuera del ascii
View non-ascii.sh
# Busca caracteres fuera del ascii
find -name '*.py' -print0 |xargs -0 grep -P '[^\x00-\x7f]' > /tmp/non-ascii.txt
@felipem775
felipem775 / settings.json
Created Sep 2, 2019
Settings para que VSCode muestre los test de python con la posibilidad de ejecutar en debug
View settings.json
{
"python.pythonPath": "env/bin/python",
"pythonTestExplorer.testFramework": "unittest",
"python.testing.unittestArgs": [
"-v",
"-s",
"./tests",
"-p",
"test_*.py"
],
View goreviewpartner config.ini
[General]
language = en
sgffolder = /tmp
rsgffolder =
pngfolder =
livefolder = live_analysis
stonesound =
[Analysis]
maxvariations = 26
View plot.py
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 Oct 17, 2018
untar files in a different path
View untarFiles.sh
for filename in *.tar; do
tar -xf "$filename" -C "destino"
done
@felipem775
felipem775 / findMaxValue.js
Created Jul 31, 2018
Find the object whose property "X" has the greatest value in an array of objects
View findMaxValue.js
// 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 Jun 6, 2018
convertir imágenes png a vídeo
View png2mp4
ffmpeg -framerate 10 -pattern_type glob -i '*.png' -c:v libx264 \
-r 30 -pix_fmt yuv420p out.mp4
View make_uid.sql
-- original https://stackoverflow.com/a/19532132/2428230
CREATE FUNCTION make_uid() RETURNS text AS $$
DECLARE
new_uid text;
done bool;
BEGIN
done := false;
WHILE NOT done LOOP
new_uid := upper(substring(md5(''||now()::text||random()::text),1,8));
done := NOT exists(SELECT 1 FROM report_users WHERE confirm_key=new_uid);
View update-github.sh
#!/bin/bash
export SCRIPT_PATH="`dirname \"$0\"`"
echo $SCRIPT_PATH
cd $SCRIPT_PATH
for DIR in */ ;
do
echo $DIR
cd $DIR
git remote update
cd $SCRIPT_PATH
You can’t perform that action at this time.