Skip to content

Instantly share code, notes, and snippets.

View j2deme's full-sized avatar

Jaime Jesús Delgado Meraz j2deme

  • TecNM Campus Ciudad Valles
  • Ciudad Valles, San Luis Potosi, México
  • 18:44 (UTC -06:00)
View GitHub Profile
@j2deme
j2deme / Git Improvements.md
Last active December 31, 2021 03:03
Git Improvements

Colorize Git Output

By default, ANSI color is turned off. You can enable it globally with the following command:

git config --global --add color.ui true

or on a per-repo basis:

git config --add color.ui true

http://coderwall.com/p/2ruxww

@j2deme
j2deme / array2object.php
Created August 14, 2012 21:08
"One line" PHP Array to Object
<?php
/**
* It's always nice to remeber that you can convert an array to an object just typecasting the variable.
* Clean and straight to the point :)
*/
$obj = (object) $array;
?>
@j2deme
j2deme / two lessons.md
Created November 28, 2012 17:35
An anecdote on version control

A younger programmer asked an elder about his code and his coding style, and how the older programmer would do certain things. The older programmer said 'Let's take a look at your code', so the younger took out his laptop, opened his editor, and showed him.

The older programmer looked at the code, thought about it for a bit, and then started editing it. He deleted the class internals, leaving only the structure, and then rearranged the structure, saying 'Here's how I would do it to make it more efficient and readable'. After he was done, he saved the file and gave it back to the younger programmer, who was ashen-faced.

'That... My code is gone!' said the younger programmer. 'But you have it in version control somewhere, right?' asked the elder. 'N.... no.' was the reply. 'Well then...' said the older, 'now you've learned two lessons'.

@j2deme
j2deme / How to use it.md
Created September 23, 2013 18:30
Verify if a String is a valid Url

It's very simple to use:

Boolean isValid = isUrl("http://androcode.es");
@j2deme
j2deme / whiteboardCleaner.md
Created October 8, 2015 22:40 — forked from lelandbatey/whiteboardCleaner.md
Whiteboard Picture Cleaner - Shell one-liner/script to clean up and beautify photos of whiteboards!

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert "$1" -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 "$2"

Results

Last updated: 2017-03-18

Searching for Files

Find images in a directory that don't have a DateTimeOriginal

exiftool -filename -filemodifydate -createdate -r -if '(not $datetimeoriginal) and $filetype eq "JPEG"' .

Output photos that don't have datetimeoriginal to a CSV

Note this can take a long time if you have a lot of jpgs

@j2deme
j2deme / Main.java
Created May 12, 2021 00:41
La Pizzería
package com.j2deme;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int tipo = 0;
int ingrediente = 0;
String nombreIngrediente = "";
@j2deme
j2deme / Main.java
Last active May 12, 2021 20:52
La Hora Futura
package com.j2deme;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
int horaActual = 0, cantidadHoras = 0, horaFinal = 0;
String sufijo = "am";
Scanner teclado = new Scanner(System.in);
@j2deme
j2deme / Main.java
Created May 17, 2021 19:08
Edades en Arreglos
package com.j2deme;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner teclado = new Scanner(System.in);
int cantidad = 0;
System.out.println("¿Cuántas edades desea capturar?");
@j2deme
j2deme / README.md
Last active May 19, 2021 00:49
Custom Toolbar for Xournal++

Referencias

Paleta de colores basada en Open Color

  • Blanco: 0xFFFFFF
  • Amarillo: 0xFCC419
  • Naranja: 0xFD7E14
  • Rojo: 0xF03E3E
  • Rosa: 0xF06595
  • Morado: 0xAE3EC9
  • Azul: 0x4263EB