Skip to content

Instantly share code, notes, and snippets.

View fzaninotto's full-sized avatar

Francois Zaninotto fzaninotto

View GitHub Profile

Keybase proof

I hereby claim:

  • I am fzaninotto on github.
  • I am fzaninotto (https://keybase.io/fzaninotto) on keybase.
  • I have a public key ASBetyvJjPxiytmV9p2XKAVfQdpsfz8kgdpq42sPwrbD-Qo

To claim this, I am signing this object:

@fzaninotto
fzaninotto / material-ui-10-migration-feedback.md
Created November 8, 2017 21:10
Feedback from migrating a material-ui app to 1.0

I have migrated about 11 kloc from material-ui 0.X to material ui 1.0 (a moderate size project). It has taken me more than 20 hours, and it was not a pleasant experience. cf https://github.com/marmelab/admin-on-rest/pull/1167

No Migration Path

I understand that you took the opportunity of a major BC break to rethink the API completely. But coming from 0.X, the changes often aren't consistent. Each component has changed in a different way, and for a given component, there is no way to guess the 1.0 API based on the 0.x API. Why did <ToolbarGroup> disappear? Why do I need to decompose a ListItem into so many sub components now? Why was Toggle renamed to Switch?

@fzaninotto
fzaninotto / open-source.md
Last active November 10, 2017 00:55
Marmelab notable open-source projects

Overview of Marmelab Open-Source Projects

Our research and innovation is often open-source, and adds up to more than 30 000 stars on GitHub. To learn more about our latest innovations, go to github.com/marmelab.

REST Tools

  • admin-on-rest: A frontend framework for building admin SPAs on top of REST services, using React and Material Design
  • ng-admin: Add an AngularJS admin GUI to any RESTful API
  • awesome REST: A collaborative list of great resources about RESTful API architecture, development, test, and performance
@fzaninotto
fzaninotto / admin-on-rest-no-field-error.md
Last active October 19, 2017 07:13
[admin-on-rest] [Error] No Field error on an Input component

The <LongTextInput> component wasn't called within a redux-form <Field>>.

Probable Cause

The original <LongTextInput> has an addField: true default prop. When admin-on-rest detects this prop, it automatically adds a redux-form <Field> tag. So when including an Input component in a form, like so:

const PostEdit = (props) => (
    <Edit {...props}>
        <SimpleForm>
# Ruby / Bundler / Diaspora
# Fork https://github.com/diaspora/diaspora
# Repeat 5 times
time sh -c 'git clone https://github.com/fzaninotto/diaspora.git;cd sandbox;bundle install --deployment'
rm -Rf diaspora
# commit dependencies
git clone https://github.com/fzaninotto/diaspora.git
<?php
sleep(10);
header('Content-Type: text/css');
echo 'h1 { color: red; }';
var fs = require('fs');
var request = require('request');
var async = require('async');
var apiUrl = 'http://api.flickr.com/services/upload/';
var filenames = fs.readdirSync(path);
async.forEach(filenames, function(filename, callback) {
// open a file stream on the local image
var fileStream = fs.createReadStream(path + filename);
// read from the file and write to the HTTP request
@fzaninotto
fzaninotto / ExceptionInterface.php
Created December 20, 2011 19:31
Catch Interface
<?php
interface Bar {}
class Foo extends Exception implements Bar {}
try
{
throw new Foo();
} catch (Bar $e) {
@fzaninotto
fzaninotto / gist:1308714
Created October 24, 2011 10:11
Inserting data to several tables using Faker Populator, a custom formatter, and Propel
<?php
$faker = \Faker\Factory::create();
$populator = new \Faker\ORM\Propel\Populator($faker);
$populator->addEntity('Author', 10000);
$populator->addEntity('Book', 100000, $customColumnFormatters = array(
'ISBN' => function () use ($generator) { return $generator->randomNumber(13); },
));
$populator->addEntity('Review', 1000000);
$insertedPKs = $populator->execute();