Skip to content

Instantly share code, notes, and snippets.

View fjavier's full-sized avatar
🏠
Working from home

Francisco Javier Briceño fjavier

🏠
Working from home
View GitHub Profile
@fjavier
fjavier / HibernateUtil
Created September 12, 2014 16:50
Configuracion de Proyecto Hibernate
package inss.gob.ni.hibernate;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
/**
* Created by fbriceno on 11/09/2014.
*/
public class HibernateUtil {
@fjavier
fjavier / jaro-winkler
Last active April 1, 2020 13:43
jaro-winkler postgres
create or replace function fn_porcentaje_similitud(cadena1 character varying, cadena2 character varying )
/*
@author: fbriceno
@descripcion: devuelve el porcentaje de similitud entre 2 cadenas, haciendo uso del algoritmo jaro-winkler
@return: porcentaje de similitud entre 0 y 1. entre mas cercano al 1 mayor coincidencia. mas cercano al 0 poco coincidente
@documentation: https://gist.github.com/fjavier/586c713943d76a023a70
*/
returns numeric as
$BODY$
DECLARE
@fjavier
fjavier / instala-herramientas
Last active August 29, 2015 14:06
Instalacion automatica y configuracion de herramientas para proyecto rails
#!/usr/bin/env bash
apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config
echo "Instalando curl"
apt-get install -y curl
echo "Instalando rvm"
curl -L get.rvm.io | bash -s stable
rvm
rvm requirements
# se Carga RVM si se encuentra instalado,
@fjavier
fjavier / inflections.rb
Created October 11, 2014 20:24
Pluralizacion de Tablas en Español - Rails
#encoding: UTF-8
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format. Inflections
# are locale specific, and you may define rules for as many different
# locales as you wish. All of these examples are active by default:
# ActiveSupport::Inflector.inflections(:en) do |inflect|
# inflect.plural /^(ox)$/i, '\1en'
# inflect.singular /^(ox)en/i, '\1'
# inflect.irregular 'person', 'people'
<% flash.each do |type, message| %>
<div class="alert <%= bootstrap_class_for(type) %> fade in">
<button class="close" data-dismiss="alert">×</button>
<%= message %>
</div>
<% end %>
@fjavier
fjavier / introrx.md
Created September 30, 2015 16:49 — forked from staltz/introrx.md
The introduction to Reactive Programming you've been missing

The introduction to Reactive Programming you've been missing

(by @andrestaltz)

So you're curious in learning this new thing called Reactive Programming, particularly its variant comprising of Rx, Bacon.js, RAC, and others.

Learning it is hard, even harder by the lack of good material. When I started, I tried looking for tutorials. I found only a handful of practical guides, but they just scratched the surface and never tackled the challenge of building the whole architecture around it. Library documentations often don't help when you're trying to understand some function. I mean, honestly, look at this:

Rx.Observable.prototype.flatMapLatest(selector, [thisArg])

Projects each element of an observable sequence into a new sequence of observable sequences by incorporating the element's index and then transforms an observable sequence of observable sequences into an observable sequence producing values only from the most recent observable sequence.

@fjavier
fjavier / wildfly-install.sh
Created February 2, 2018 16:44 — forked from sukharevd/wildfly-install.sh
Script to install JBoss Wildfly 10.x as service in Linux
#!/bin/bash
#title :wildfly-install.sh
#description :The script to install Wildfly 10.x
#more :http://sukharevd.net/wildfly-8-installation.html
#author :Dmitriy Sukharev
#date :2016-06-18T02:45-0700
#usage :/bin/bash wildfly-install.sh
#tested-version1 :10.0.0.CR3
#tested-distros1 :Ubuntu 15.10; Debian 7,8; CentOS 7; Fedora 22
#tested-version2 :10.0.0.Final
@fjavier
fjavier / impresion.html
Created June 27, 2018 15:55
Mostrar PDF en HTML con uso de la libreria PDF.js
<!DOCTYPE html>
<html>
<head>
<title>Prueba impresion</title>
<!-- DESCARGAR LA LIBRERIA E UTILIZARLA -->
<script type="text/javascript" src="./build/pdf.js"></script>
<script type="text/javascript" src="./build/pdf.worker.js"></script>
</head>
<body>
<h1>Ejemplo PDF.js</h1>