Skip to content

Instantly share code, notes, and snippets.

View marti1125's full-sized avatar
๐Ÿ

Willy Aguirre marti1125

๐Ÿ
View GitHub Profile
@marti1125
marti1125 / example.geojson
Created September 26, 2013 23:44
geonjson
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
update Reunion set diaDeLaSemana = datepart(dw,fechaDeSesion) - 1
@marti1125
marti1125 / gist:7112800
Last active December 26, 2015 07:09
manifest.webapp
{
"name": "Paint",
"description": "Paint",
"launch_path": "/index.html",
"version": "2.0",
"icons": {
"60": "/img/60.png",
"120": "/img/120.png",
"128": "/img/128.png"
},
@marti1125
marti1125 / gist:7296629
Created November 4, 2013 01:00
scrap with java
package scrapweb;
import java.io.IOException;
import org.jsoup.*;
import org.jsoup.nodes.Document;
import org.jsoup.select.Elements;
/**
*
* @author Willy
@marti1125
marti1125 / gist:7344373
Created November 6, 2013 21:25
first and last day of month
$("#cbPeriodos").change(function(){
var periodo = $("#cbPeriodos option:selected").text();
var anio = periodo.substring(0,4);
var mes = periodo.substring(4,6);
var fecha = new Date(anio+'/'+mes+'/01');
var firstDay = new Date(fecha.getFullYear(), fecha.getMonth(), 1);
var lastDay = new Date(fecha.getFullYear(), fecha.getMonth() + 1, 0);
@marti1125
marti1125 / gist:7405008
Created November 10, 2013 22:51
get first day and last day of month using jodatime
DateTimeFormatter formatterFecha = DateTimeFormat.forPattern("dd/MM/yyyy");
DateTime primerDiaDelMes = new DateTime().dayOfMonth().withMinimumValue();
String desde = new LocalDate(primerDiaDelMes).toString(formatterFecha);
DateTime ultimoDiaDelMes = new DateTime().dayOfMonth().withMaximumValue();
String hasta = new LocalDate(ultimoDiaDelMes).toString(formatterFecha);
@marti1125
marti1125 / gist:7713792
Created November 30, 2013 00:32
change filters jquery
var $cborgAcademica = $("#cbOrgAcademica");
var $cbGradoAcademicos = $("#cbGradosAcademicos");
var $cbFrecuencias = $("#cbFrecuencias");
$cborgAcademica.change(function(){
$cbGradoAcademicos.empty();
$cbFrecuencias.empty();
$cbGradoAcademicos.append('<option value="0" selected>Todos</option>');
$cbFrecuencias.append('<option value="0" selected>Todos</option>');
@marti1125
marti1125 / gist:7713852
Created November 30, 2013 00:37
backbone form evente change in select
formView.form.on('organizacionAcademica:change', function(form, editor) {
idOrganizacionAcademica = editor.getValue();
gradosAcademicos.fetch({
url: 'GradosAcademicos/listarPorOrganizacionAcademicaConSeleccione?idOrganizacionAcademica=' + idOrganizacionAcademica,
reset:true,
success: function() {
formView.form.fields.gradoAcademico.editor.setOptions(gradosAcademicos);
}});
frecuencias.fetch({
url: 'Frecuencias/listavacia',
@marti1125
marti1125 / gist:7885287
Last active December 30, 2015 21:09
cell
{
name: "rechazo",
label: "Rechazos",
editable: false,
cell: Backgrid.Cell.extend({
render: function () {
if(this.model.attributes['rechazos'] > 0) {
this.$el.html('<a class="botonrechazo-centro-periodo" data-id="' + this.model.attributes['id'] + '" role=button href="#modalAccionesCPRechazos" data-toggle="modal"><button class="btn">Historial de Rechazos ('+ this.model.attributes['rechazos'] +')</button></a>');
} else {
this.$el.html('<button class="btn" disabled>Historial de Rechazos ('+this.model.attributes['rechazos']+')</button>');
@marti1125
marti1125 / gist:7894720
Created December 10, 2013 17:39
chosen update
var $cborgAcademica = $("#cbOrgAcademica");
var $cbGradoAcademicos = $("#cbGradosAcademicos");
var $cbFrecuencias = $("#cbFrecuencias");
$cborgAcademica.change(function(){
$cbGradoAcademicos.empty();
var idOrgAcademica= $(this).val();
if (idOrgAcademica!= "0"){