Skip to content

Instantly share code, notes, and snippets.

Francois Zaninotto fzaninotto

Block or report user

Report or block fzaninotto

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

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 Nov 8, 2017
Feedback from migrating a material-ui app to 1.0
View material-ui-10-migration-feedback.md

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 Nov 10, 2017
Marmelab notable open-source projects
View open-source.md

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 Oct 19, 2017
[admin-on-rest] [Error] No Field error on an Input component
View admin-on-rest-no-field-error.md

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>
View diaspora.sh
# 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
View gist:6487656
View css.php
<?php
sleep(10);
header('Content-Type: text/css');
echo 'h1 { color: red; }';
View gist:2945620
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
View ExceptionInterface.php
<?php
interface Bar {}
class Foo extends Exception implements Bar {}
try
{
throw new Foo();
} catch (Bar $e) {
@fzaninotto
fzaninotto / gist:1308714
Created Oct 24, 2011
Inserting data to several tables using Faker Populator, a custom formatter, and Propel
View gist:1308714
<?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();
You can’t perform that action at this time.