This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Script to run pep8 and pyflakes via git's pre-commit hook | |
Based on https://github.com/lbolla/dotfiles/blob/master/githooks/pre-commit | |
Modified by Martin Gaitán <mgaitan@machinalis.com> for Machinalis (www.machinalis.com) | |
Install: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"auto_complete_delay": 500, | |
"detect_indentation": false, | |
"file_exclude_patterns": | |
[ | |
".*", | |
"*.pyc", | |
"*.pyo", | |
"*.exe", | |
"*.dll", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Integrate our branch into origin/develop | |
# | |
# It's a shortcut for : | |
# | |
# 1. pull for last changes on develop | |
# 2. rebase the target branch against develop | |
# 3. recheck if no changes happen in the meanwhile | |
# 4. merge --no-ff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# python (django) side: | |
from django.http import StreamingHttpResponse | |
import time | |
def stream(request): | |
def event_stream(): | |
while True: | |
time.sleep(3) | |
yield 'data: %s\n\n' % 'hola mundo' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Goread.io send by gmail | |
// @description Add a send by email action link after go to page icon | |
// @version 1 | |
// @author Martín Gaitán | |
// @include http://www.goread.io/* | |
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js | |
// ==/UserScript== | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def marquesina(cadena, ancho=60, alto=1, caracter="*"): | |
cadena = str(cadena).center(ancho) | |
cadena = caracter + cadena[1:-1] + caracter | |
cadena += '\n' | |
relleno = " " * ancho | |
relleno = caracter + relleno[1:-1] + caracter | |
relleno += '\n' | |
tapa = caracter * ancho | |
return tapa + '\n' + relleno * alto + cadena + relleno * alto + tapa |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def distance(X): | |
""" | |
Computes the distance between m points using Euclidean distance (2-norm) | |
as the distance metric between the points. | |
The points are arranged as m n-dimensional row vectors in the matrix X. | |
""" | |
# agregamos una dimension. Ahora X.shape == (m, 1, n) | |
# Por ejemplo np.all(X[0] == X_dim_plus[0, 0]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CodeMirror.defineMode("fortran", function(conf, parserConf) { | |
var ERRORCLASS = 'error'; | |
function wordRegexp(words) { | |
return new RegExp("^((" + words.join(")|(") + "))\\b", "i"); | |
} | |
var Operators = new RegExp("(\.and\.|\.or\.|\.eq\.|\.lt\.|\.le\.|\.gt\.|\.ge\.|\.ne\.|\.not\.|\.eqv\.|\.neqv\.)", "i"); | |
var Operators2 = new RegExp("((==)|(/=)|(=)|(<=)|(>=)|(/)|(//))"); //" |(\\*\\*)|\-|\+|\/\/|\/|(?!^)\*)"); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer