This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* I needed it 'cause I have a generic js to add embeded subForms to a Form | |
* appending the prototype upon AddButton JQuery click event. So to add event | |
* bindings to one of the controls generated out of the prototype template, which | |
* is unknown to the js that adds it, I fire a message like "prototype_just_added" | |
* and the specific js catches it and binds the event. | |
*/ | |
/* | |
* MediatorPatter implementaton to allow for some behavior extensions. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Recursive Prototype Clonner: | |
* it relies on the following data structure: | |
* <someAncestor data-allow-add="true"> ... | |
* <button class="" data-add="add" | |
* data-add-prototype-node="JQ selector relative to $button.closest('[data-allow-add]'). Will be parameter of $obj.find($selector)" | |
* data-add-prototype-name="<?php echo $prototypeName; ?> optional, defauts to __name__" | |
* data-add-append-node="%data-add-prototype-node% | JQ selector relative to $button.closest('[data-allow-add]'). | |
* Will be parameter of $obj.find($selector)" | |
* data-add-wrapper="html to wrap the cloned item before appending e.g. <li>__PROTOTYPE-CONTENT__</li>" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#The Config File | |
# The tool: https://github.com/juanmf/RedmineIssueImporter | |
#Use the following config file format to import sheets into redmine. So far it creates Issues, | |
#with custom fields, but it's extensible to add users, etc.. | |
################################################################################ | |
# Run customization |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Application\ProcessBundle\Subscriber; | |
//Since Doctrine 2.4 | |
//use Doctrine\Common\Persistence\Event\LifecycleEventArgs; | |
//use Doctrine\Common\Persistence\Event\PreUpdateEventArgs; | |
use Symfony\Bridge\Monolog\Logger as SfLogger; | |
use Doctrine\Common\EventSubscriber; | |
use Doctrine\Common\Persistence\Mapping\ClassMetadata; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Collections; | |
import java.util.Map; | |
import java.util.TreeMap; | |
/** | |
* Usage: | |
* | |
* Stopwatch.start("watchName"); | |
* ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* The MIT License | |
* | |
* Copyright 2016 juan.fernandez. | |
* | |
* Permission is hereby granted, free of charge, to any person obtaining a copy | |
* of this software and associated documentation files (the "Software"), to deal | |
* in the Software without restriction, including without limitation the rights | |
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
* copies of the Software, and to permit persons to whom the Software is |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This script can be automatically triggered with IFTTT Stocks trigger and should | |
* be called with the following query string params: | |
* | |
* inputCurrency={{InputCurrency}} | |
* outputCurrency={{OutputCurrency}} | |
* exchangeRate={{ExchangeRate}} | |
* infoUrl={{InfoUrl}} | |
* checkTime={{CheckTime}} | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany; | |
/** | |
* Created by juanmf on 15/07/17. | |
*/ | |
import java.util.Arrays; | |
import java.util.stream.Collectors; | |
import org.apache.spark.api.java.*; | |
import org.apache.spark.SparkConf; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lombok.AllArgsConstructor; | |
import org.junit.Test; | |
import java.util.concurrent.CompletableFuture; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.Executor; | |
import java.util.concurrent.ForkJoinPool; | |
import java.util.concurrent.TimeUnit; | |
import java.util.concurrent.atomic.AtomicBoolean; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
/** | |
* Horse problem solved with my niece. | |
*/ | |
public class Caballo { | |
private static byte[][] tablero = new byte[][] | |
{{0, 0, 0, 0, 0, 0, 0, 0}, | |
{0, 0, 0, 0, 0, 0, 0, 0}, | |
{0, 0, 0, 0, 0, 0, 0, 0}, |
OlderNewer