Skip to content

Instantly share code, notes, and snippets.

View ijaureguialzo's full-sized avatar
🌍
...

Ion Jaureguialzo Sarasola ijaureguialzo

🌍
...
View GitHub Profile
@ijaureguialzo
ijaureguialzo / ImagenBoton.java
Last active November 22, 2016 23:59
Modificar la imagen de un botón en Java
private boolean o = true;
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
ImageIcon imagenO = new ImageIcon("o.png");
ImageIcon imagenX = new ImageIcon("x.png");
if (o) {
jButton2.setIcon(imagenO);
} else {
@ijaureguialzo
ijaureguialzo / BotonConBorde.swift
Created November 22, 2016 17:17
Botón con borde en Swift
//
// Botón con borde basado en http://stackoverflow.com/a/38154358
//
import UIKit
@IBDesignable class BotonConBorde: UIButton {
@IBInspectable var ancho: CGFloat = 0 {
didSet {
@ijaureguialzo
ijaureguialzo / osx_ramdisk.sh
Last active May 26, 2017 05:47 — forked from jnschulze/osx_ramdisk.sh
Crear y publicar un ramdisk con node.js
#!/bin/bash
# Size at the end is * 2048 where 2048 = 1 MB, so 1572864 = 768 MB
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://8388608` # 4 GB
/usr/sbin/diskutil erasevolume HFS+ "RamDisk" $DISK
RAMDISK="/Volumes/RamDisk/ova"
mkdir $RAMDISK
@ijaureguialzo
ijaureguialzo / temas.sh
Created July 12, 2017 15:09
Todos los temas de highlight
#!/bin/bash
TEMAS=`ls -1 /usr/local/share/highlight/themes/ | cut -f 1 -d "."`
for T in $TEMAS
do
highlight -i test.java -O rtf -o $T.rtf --syntax java --font "SF Mono" --style $T --font-size 12
done
@ijaureguialzo
ijaureguialzo / maven+ojdbc8.md
Last active January 4, 2022 10:48
Añadir el driver Oracle JDBC a un proyecto Maven en IntelliJ

Añadir el driver Oracle JDBC a un proyecto Maven en IntelliJ

  1. Descargar el archivo ojdbc8.jar desde la web de Oracle.
  2. Crear la carpeta lib en la carpeta raíz del proyecto de IntelliJ (al mismo nivel que el pom.xml)
  3. Mover el archivo ojdbc8.jar a la carpeta lib.
  4. Añadir la dependencia al fichero pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
@ijaureguialzo
ijaureguialzo / livetemplate.md
Last active November 22, 2018 09:38
Plantilla para para IntelliJ IDEA
java.io.BufferedReader br = new java.io.BufferedReader(new java.io.InputStreamReader(System.in));
@ijaureguialzo
ijaureguialzo / Main.java
Created November 24, 2018 11:23
Tablero de ajedrez
package com.jaureguialzo;
public class Main {
public static void main(String[] args) {
// La mejor visualización se consigue poniendo como fuente de consola el tipo de letra "Arial Unicode MS"
char[][] tablero = {
{'♜', '♞', '♝', '♛', '♚', '♝', '♞', '♜'},
// Segue
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "siguientePantalla" {
let destino = segue.destination as! OtroViewController;
}
}
// Unwind
@IBAction func guardar(segue: UIStoryboardSegue) {
@ijaureguialzo
ijaureguialzo / _open_multiple_intellij_projects.md
Last active April 2, 2019 08:28
Script para abrir varios proyectos de IntelliJ a la vez

Abrir todos los proyectos de IntelliJ que haya en subdirectorios

@ijaureguialzo
ijaureguialzo / replica.sh
Created January 15, 2019 13:09
Replica de un disco con rsync
#!/bin/bash
OPCIONES="-a --delete --partial --progress" # Apple rsync
#OPCIONES="-a --delete --partial --info=progress2" # Homebrew rsync
ORIGEN="/Volumes/seagate"
DESTINO="/Volumes/seagate copia"
if [ -e "$ORIGEN" ] && [ -e "$DESTINO" ]
then