Skip to content

Instantly share code, notes, and snippets.

Avatar

Pablo Moretti pablomoretti

  • MercadoLibre
  • Argentina
View GitHub Profile
@pablomoretti
pablomoretti / gist:9748230
Created Mar 24, 2014
SimpleDateFormatThreadSafe
View gist:9748230
package com.foocoders.text;
import java.text.AttributedCharacterIterator;
import java.text.DateFormatSymbols;
import java.text.FieldPosition;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Calendar;
@pablomoretti
pablomoretti / LockByName
Created Dec 22, 2013
Get lock by name using java.util.concurrent
View LockByName
package com.mercadolibre.concurrent;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.locks.ReentrantLock;
public class LockByName<L> {
ConcurrentHashMap<String, L> mapStringLock;
public LockByName(){
View gist:1409131
package buflo.util
import org.apache.commons.lang.time.FastDateFormat;
//import org.joda.time.format.ISO8601DateFormat;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormatter;
import org.joda.time.format.ISODateTimeFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
View MemcachedClientFactoryBean.java
package net.spy.memcached.utils;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import net.spy.memcached.MemcachedClient;
import org.springframework.beans.factory.FactoryBean;
public class MemcachedClientFactoryBean implements FactoryBean<MemcachedClient> {
@pablomoretti
pablomoretti / get-item.php
Created Oct 17, 2011
MercadoLibre - GET ITEM - EXAMPLE PHP
View get-item.php
<?php
header('Content-Type: text/html; charset=utf-8');
// we recommend use most robust http client.
// http://www.google.com/search?q=http+client+php
function http_client_get($url) {
//busco el contenido un archivo por si lo habia guardado anteriormente
$reponse = unserialize(@file_get_contents(sys_get_temp_dir() . "/cache_http_client_get-" . str_replace("/", ".",$url)));
View jsbin.kijit.html
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
<link href="http://udacity-crp.herokuapp.com/style.css?rtt=1" rel="stylesheet">
</head>
<body>
<span></span>