Skip to content

Instantly share code, notes, and snippets.

View IsaacGonzalez's full-sized avatar

Isaac González IsaacGonzalez

View GitHub Profile
@IsaacGonzalez
IsaacGonzalez / build-common-theme.xml
Created April 11, 2014 18:10
Archivo build-common-theme.xml para Liferay 6.2 que incluye el tema welcome-theme para poder crear temas basados de el.
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="build-common-theme">
<import file="../build-common-plugin.xml" />
<target name="build-css">
<java
classname="com.liferay.portal.tools.SassToCssBuilder"
classpathref="portal.classpath"
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Pagina</title>
<style>
header{
width: 80%;
}
.container{
@IsaacGonzalez
IsaacGonzalez / details.jsp
Created May 26, 2014 23:42
Versión slimmed down del archivo details.jsp para Liferay 6.2 GA2, la cual solo deja visible la funcionalidad para cambiar el retrato del usuario.
<%--
/**
* Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
@IsaacGonzalez
IsaacGonzalez / portal.properties
Last active August 29, 2015 14:04
Propiedades para incluir todos los archivos de javascript en barebone.jsp y everything.jsp
javascript.barebone.files=\
\
#
# YUI core
#
\
aui/aui/aui.js,\
aui/aui-base-html5-shiv/aui-base-html5-shiv.js,\
\
#
if(typeof YUI!="undefined"){YUI._YUI=YUI}var YUI=function(){var c=0,f=this,b=arguments,a=b.length,e=function(h,g){return(h&&h.hasOwnProperty&&(h instanceof g))},d=(typeof YUI_config!=="undefined")&&YUI_config;if(!(e(f,YUI))){f=new YUI()}else{f._init();if(YUI.GlobalConfig){f.applyConfig(YUI.GlobalConfig)}if(d){f.applyConfig(d)}if(!a){f._setup()}}if(a){for(;c<a;c++){f.applyConfig(b[c])}f._setup()}f.instanceOf=e;return f};(function(){var q,b,r="patched-v3.11.0",i=".",o="http://yui.yahooapis.com/",u="yui3-js-enabled",d="yui3-css-stamp",m=function(){},h=Array.prototype.slice,s={"io.xdrReady":1,"io.xdrResponse":1,"SWF.eventHandler":1},g=(typeof window!="undefined"),f=(g)?window:null,w=(g)?f.document:null,e=w&&w.documentElement,a=e&&e.className,c={},j=new Date().getTime(),n=function(A,z,y,x){if(A&&A.addEventListener){A.addEventListener(z,y,x)}else{if(A&&A.attachEvent){A.attachEvent("on"+z,y)}}},v=function(B,A,z,x){if(B&&B.removeEventListener){try{B.removeEventListener(A,z,x)}catch(y){}}else{if(B&&B.detachEvent){B.de
public class Test{
private void Button_Click(object sender, RoutedEventArgs e){
Empleado empleadoABorrar = null;
for(var empleado in lista1){
if(empleado.getNombre().Equals(this.t1.Text))
empleadoABorrar = empleado;
}
<?php
// localhost/multipart_tet
var $response = array();
// Agarramos el archivo
var $foto = $_FILES["file"]
// Vemos cuales headers son los que están llegando
//@Test
public void testSuccesfulSPEIPMCreate() throws Exception {
valid_payment_method = new JSONObject(
"{'description':'Stogies',"
+ "'reference_id':'9839-wolf_pack',"
+ "'amount':20000,"
+ "'currency':'MXN',"
+ "'details':"
+ "{"
@IsaacGonzalez
IsaacGonzalez / ArduinoMotorPosiciones.ino
Created October 19, 2015 03:28
Código para hacer que un motor de impresora se mueva a las 5 posiciones establecidas mediante un arduino y una serie de push buttons.
#include <NewPing.h>
#define TRIGGER_PIN 8
#define ECHO_PIN 9
#define MAX_DISTANCE 200
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE);
const int pin_boton_1 = 2;
const int pin_boton_2 = 3;
@IsaacGonzalez
IsaacGonzalez / gist:5446872
Created April 23, 2013 19:55
Utilizando reflection en JAVA para verificar que ninguno de los atributos de un objeto sea null
for(Field f: constanciaSimple.getClass().getFields()){
f.setAccesible(true);
try{
assertNotNull(f.get(constanciaSimple));
} catch (IllegalArgumentException e){
e.printStackTrace();
} catch (IllegalArgumentException e){
e.printStackTrace();
}
}