Skip to content

Instantly share code, notes, and snippets.

View maxwellnewage's full-sized avatar

Maximiliano Burgos maxwellnewage

View GitHub Profile
@maxwellnewage
maxwellnewage / listbox_dinamico.js
Created October 31, 2012 17:52
Listbox que genera otro listbox
//escucha el cambio de provincia y guarda dicho valor en una variable. Luego la envia con metodo post a otro
//script php que trabaja la informacion y la devuelve generando las opciones de otro listbox
$(document).ready(function(){
$("#provincia").change(function () {
$("#provincia option:selected").each(function () {
elegido=$(this).val();
$.post("comprobar_registro.php", { elegido: elegido }, function(data){
$("#localidad").html(data);
});
@maxwellnewage
maxwellnewage / dialog-confirm.js
Last active December 11, 2015 02:28
borra entradas mediante jquery ui dialog
$().ready(function () {
$("a.borrar").live('click', function (e) {
e.preventDefault();
tag_camp = $(this).parent("h3").parent(".info_suc_config");
$("#dialog-confirm").dialog({
resizable: true,
height: 140,
modal: true,
show: "slow",
title: "Desea borrar la entrada?",
@maxwellnewage
maxwellnewage / suma_resta.js
Created January 14, 2013 14:16
suma y resta con dos botones y los muestra en un div
$().ready(function(){
var cont = 0;
$("#sumar").click(function(){
cont++;
$("#result").html(cont);
});
$("#restar").click(function(){
cont--;
@maxwellnewage
maxwellnewage / select_option.js
Created January 14, 2013 14:18
en base a una seleccion del select option, imprime un mensaje en el div
$().ready(function(){
$("#selector").on('change', function(){
switch($("#selector option:selected").val()) {
case "1":
$("#mensaje").html("buena opcion");
break;
case "2":
$("#mensaje").html("medianamente buena opcion");
break;
@maxwellnewage
maxwellnewage / show_hide_campo.js
Created January 14, 2013 14:20
oculta y muestra el campo texto con un boton
$().ready(function(){
$("#mostrar").click(function(e){
$("#textbox").show();
});
$("#ocultar").click(function(e){
$("#textbox").hide();
});
//method for move a button on the screen (min API 19)
public void moveButton(){
View buttonAnimation = findViewById(R.id.buttonAnimation);
TransitionManager.beginDelayedTransition(rlAnimation);
RelativeLayout.LayoutParams positionRules = new RelativeLayout.LayoutParams(RelativeLayout.LayoutParams.WRAP_CONTENT,RelativeLayout.LayoutParams.WRAP_CONTENT);
positionRules.addRule(RelativeLayout.ALIGN_PARENT_BOTTOM, RelativeLayout.TRUE);
positionRules.addRule(RelativeLayout.ALIGN_PARENT_RIGHT, RelativeLayout.TRUE);
#ifdef _H_LTEXTURE
#define _H_LTEXTURE
#include <SDL.h>
#include <iostream>
/**
* \brief Create a texture with our modifications
*/
class LTexture
@maxwellnewage
maxwellnewage / APIController.php
Created July 10, 2018 21:20
generic class for resources controllers on Laravel
<?php
namespace App\Http\Controllers;
use Illuminate\Database\QueryException;
use Illuminate\Http\Request;
class APIController extends Controller
{
public static function index($model, $relation = null)
@maxwellnewage
maxwellnewage / provinces.json
Last active September 20, 2019 19:48
Lista de Provincia - Localidad de Argentina con su localidad en JSON.
[
{
"name" : "BUENOS AIRES",
"locations": [
"25 DE MAYO",
"30 DE AGOSTO",
"9 DE JULIO",
"ALBERTI",
"AMEGHINO",
"AMERICA",