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
# Deployment server info | |
set :application, "Nombre aplicación aquí" | |
set :domain, "127.0.0.1" | |
set :deploy_to, "/var/www/" | |
set :app_path, "app" | |
set :web_path, "web" | |
# SCM info | |
set :repository, "http://github.com/alfonsomga/*" | |
set :scm, :git |
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
//Retorna: 1 = NIF ok, 2 = CIF ok, 3 = NIE ok, -1 = NIF error, -2 = CIF error, -3 = NIE error, 0 = ??? error | |
function valida_nif_cif_nie(a){ | |
var temp = a.toUpperCase(); | |
var cadenadni = "TRWAGMYFPDXBNJZSQVHLCKE"; | |
if( temp!= '' ) { | |
//si no tiene un formato valido devuelve error | |
if( ( !/^[A-Z]{1}[0-9]{7}[A-Z0-9]{1}$/.test( temp ) && !/^[T]{1}[A-Z0-9]{8}$/.test( temp ) ) && !/^[0-9]{8}[A-Z]{1}$/.test( temp ) ){ | |
return 0; | |
} | |
//comprobacion de NIFs estandar |
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
<?php | |
/* | |
Creo que llegados a este punto es hora de ponernos algo serios y empezar a inculcar | |
las buenas prácticas a los programadores, para que poco a poco se vaya consiguiendo | |
obtener desarrollos con estructura de código similar y homogénea, en vez de lo que | |
hay ahora, que cada uno pone lo que cree mas oportuno de la manera que cree que es | |
mas correcta, es muy importante que los proyectos sean fáciles de mantener y que | |
el código que ha hecho A lo pueda mantener B o incluso C sin tener que recurrir | |
ninguno a preguntarle a A por que se hizo eso asi o cosas similares. | |
Es por eso que he pensado en publicar finalmente el manual de coding standards que |
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/python | |
import httplib2 | |
import sys | |
from apiclient.discovery import build | |
from apiclient.errors import HttpError | |
from oauth2client.client import flow_from_clientsecrets | |
from oauth2client.file import Storage | |
from oauth2client.tools import argparser, run_flow |
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
/* Randoms */ | |
if (!document.title) { | |
document.title = document.URL; | |
} | |
/* Keylib */ | |
// Alphanumeric | |
document.addEventListener('keypress', function (e) { | |
e = e || window.event; |
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
var _yt_www = {}; | |
(function(g) { | |
var window = this; | |
var baa, caa, Ca, ab, kaa, bb, cb, db, eb, jb, laa, kb, maa, naa, rb, Db, Tb, uc, uaa, vaa, taa, Vc, $c, ad, gd, id, yaa, nd, rd, ld, jd, Aaa, qd, od, pd, td, zaa, yd, Baa, Caa, Pd, Ud, Wd, Xd, Yd, Gaa, Faa, me, Ae, Haa, Le, Se, Re, Jaa, Kaa, Te, Ue, We, Laa, $e, ff, ef, af, kf, Raa, of, lf, mf, Paa, rf, qf, tf, df, Ye, Xe, Ze, uf, hf, sf, jf, wf, Taa, Oaa, Cf, Df, Gf, Jf, Lf, $aa, dg, eg, hg, fg, aba, og, vg, ug, bba, yg, zg, Ag, Bg, Eg, Gg, Hg, Ig, Lg, Kg, Ng, Jg, Og, Cg, Fg, gba, Pg, Qg, hba, iba, Wg, Yg, $g, oba, nba, mba, hh, lba, jba, kba, pba, oh, qba, ph, rh, rba, sba, sh, th, yh, Ch, Dh, Eh, Hh, Ih, Jh, yba, zba, zh, Bh, xh, xba, Ah, Cba, Rh, Qh, Sh, Bba, Th, Eba, Dba, Fba, Gba, Uh, Vh, na, aaa; | |
g.ba = function(a) { | |
return function() { | |
return g.aa[a].apply(this, arguments) | |
} | |
} | |
; |
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
function resilientRequest(options) { | |
var url = options.url; | |
var method = options.method || 'GET'; | |
var data = options.data || {}; | |
var callback = options.callback || function() {}; | |
var tries = typeof options.tries !== 'undefined' ? options.tries : 50; | |
var timeout = options.timeout || 60 * 60 * 1000; //1 hour | |
if (typeof data === 'object') { | |
data = objectToQueryString(data); |
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
// @flow | |
const { readdirSync, statSync } = require('fs'); | |
const { join } = require('path'); | |
const { spawn } = require('child_process'); | |
const getDirs = p => | |
readdirSync(p).filter(f => statSync(join(p, f)).isDirectory()); | |
// Get a list of all non-build directories in the root folder | |
const rootDirs = getDirs(join(__dirname, '..')).filter( |
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
export const transformApolloErr = e => { | |
const err = e; | |
err.message = err.message.toLowerCase(); | |
const transformedErr = { | |
message: null, | |
type: undefined, | |
data: {}, | |
}; |
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
let redirectTo = '/dashboard'; | |
if (location.state && location.state.from) { | |
const { pathname, search, hash } = location.state.from; | |
redirectTo = `${pathname + search + hash}`; | |
} |
OlderNewer