Skip to content

Instantly share code, notes, and snippets.

import org.apache.commons.codec.digest.DigestUtils;
import org.apache.commons.codec.binary.Base64;
String sStringToDigest = InputString + "&" + sSecretString;
byte[] bMac = DigestUtils.md5 (sStringToDigest.getBytes());
String sMacEncoded = Base64.encodeBase64String (bMac);
sMacEncoded = sMacEncoded.substring (0,24);
module.exports = function(grunt) {
grunt.initConfig({
po2mo: {
files: {
expand: true,
src: "fr_FR.po"
}
}

Keybase proof

I hereby claim:

  • I am MicheleBertoli on github.
  • I am michelebertoli (https://keybase.io/michelebertoli) on keybase.
  • I have a public key whose fingerprint is 480D 8CBC F756 24CA B7A1 A76D 418E E122 4BA4 8E02

To claim this, I am signing this object:

@MicheleBertoli
MicheleBertoli / gist:e1709419c87282cafbb7
Created June 19, 2015 15:55
Gmaps demo with dynamic markers
import React from 'react';
import {Gmaps, Marker} from '../dist';
import {MapEvents} from '../dist/components/events';
let styles = {
item: {
backgroundColor: 'white',
transition: 'background-color 0.2s linear'
},
cols: {
@MicheleBertoli
MicheleBertoli / Counter.js
Created June 24, 2015 11:12
react-kickstart
import React, { Component, PropTypes } from 'react';
import './Counter.css';
export default class Counter extends Component {
render() {
const { count, handleClick } = this.props;
return (
<div className="Counter">
@MicheleBertoli
MicheleBertoli / react-router-context.js
Created July 17, 2015 15:42
If you want to test a react 0.13.3 component and you are using the react-router 0.13.3, you need this:
import React, {Component} from 'react';
export default ReactRouterContext = (Element) => {
class RouterStub {}
RouterStub.makePath = () => {};
RouterStub.makeHref = () => {};
RouterStub.transitionTo = () => {};
RouterStub.replaceWith = () => {};
@MicheleBertoli
MicheleBertoli / demo.js
Created August 13, 2015 09:48
Gmaps Circle
import React from 'react';
import {Gmaps, Circle} from 'react-gmaps';
const coords = {
lat: 51.5258541,
lng: -0.08040660000006028
}
const App = React.createClass({
@MicheleBertoli
MicheleBertoli / demo.js
Last active August 29, 2015 14:27
Gmaps React Routing
import React from 'react';
import Router, {RouteHandler, Route, DefaultRoute, Link} from 'react-router';
import {Gmaps, Circle} from 'react-gmaps';
const coords = {
lat: 51.5258541,
lng: -0.08040660000006028
}
const App = React.createClass({
@MicheleBertoli
MicheleBertoli / demo.js
Created August 13, 2015 20:07
Gmaps Bounds
import React from 'react';
import {Gmaps, Circle} from 'react-gmaps';
const coords = {
lat: 51.5258541,
lng: -0.08040660000006028
}
const App = React.createClass({
@MicheleBertoli
MicheleBertoli / demo.js
Created August 22, 2015 06:13
Gmaps Center on Resize
import React from 'react';
import {Gmaps} from 'react-gmaps';
const coords = {
lat: 51.5258541,
lng: -0.08040660000006028
};
const App = React.createClass({