Giter Club home page Giter Club logo

badge-poser's People

Contributors

agiuliano avatar alessandrominoccheri avatar carlo1138 avatar cirpo avatar cornernote avatar dependabot-preview[bot] avatar dependabot[bot] avatar dlondero avatar doncallisto avatar dralbert avatar elfo404 avatar eux avatar fabiocicerchia avatar garak avatar giorrrgio avatar heiglandreas avatar hpatoio avatar jean85 avatar jellybellydev avatar leopro avatar liuggio avatar matteosister avatar nyholm avatar raphaelstolt avatar rogeriopradoj avatar stof avatar tedivm avatar toretto460 avatar zerai avatar zorfling avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

badge-poser's Issues

error on assets on deploy

after #94 I got an error during the deploy.

@hpatoio please have a look to this bug:
I had problem during app/console assetic:dump --env=prod

seems that YUI compressor doesn't like the js

4:56 liuggio/Projects/badge-poser (cs_fixes) $app/console assetic:dump --env=prod
Dumping all prod assets.
Debug mode is off.

15:36:05 [dir+] /home/liuggio/Projects/badge-poser/app/../web/css
15:36:05 [file+] /home/liuggio/Projects/badge-poser/app/../web/css/7dd5d02.css
15:36:07 [dir+] /home/liuggio/Projects/badge-poser/app/../web/js
15:36:07 [file+] /home/liuggio/Projects/badge-poser/app/../web/js/7866465.js



  [Assetic\Exception\FilterException]                                                                                                                                                       
  An error occurred while running:                                                                                                                                                          
  '/usr/bin/java' '-jar' '/home/liuggio/Projects/badge-poser/app/Resources/java/yuicompressor-2.4.6.jar' '--charset' 'UTF-8' '-o' '/tmp/YUI-OUT-TkJMiu' '--type' 'js' '/tmp/YUI-IN-CyKqNw'  

  Error Output:                                                                                                                                                                             

  [ERROR] 24:41:missing formal parameter                                                                                                                                                    

  [ERROR] 24:41:missing } after function body                                                                                                                                               

  [ERROR] 25:38:identifier is a reserved word                                                                                                                                               

  [ERROR] 26:15:invalid return                                                                                                                                                              

  [ERROR] 27:5:syntax error                                                                                                                                                                 

  [ERROR] 29:44:identifier is a reserved word                                                                                                                                               

  [ERROR] 30:23:identifier is a reserved word                                                                                                                                               

  [ERROR] 31:5:syntax error                                                                                                                                                                 

  [ERROR] 90:1:syntax error                                                                                                                                                                 

  [ERROR] 1:0:Compilation produced 9 syntax errors.                                                                                                                                         
  org.mozilla.javascript.EvaluatorException: Compilation produced 9 syntax errors.                                                                                                          
    at com.yahoo.platform.yui.compressor.YUICompressor$1.runtimeError(YUICompressor.java:154)                                                                                                
    at org.mozilla.javascript.Parser.parse(Parser.java:392)                                                                                                                                  
    at org.mozilla.javascript.Parser.parse(Parser.java:337)                                                                                                                                  
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)                                                                                           
    at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)                                                                                          
    at com.yahoo.platform.yui.compressor.YUICompressor.main(YUICompressor.java:131)                                                                                                          
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)                                                                                                                           
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)                                                                                                         
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)                                                                                                 
    at java.lang.reflect.Method.invoke(Method.java:606)                                                                                                                                      
    at com.yahoo.platform.yui.compressor.Bootstrap.main(Bootstrap.java:21)                                                                                                                   


  Input:                                                                                                                                                                                    
  $(document).ready(function(){                                                                                                                                                             

      $("#repository").select2({                                                                                                                                                            
          placeholder: "vendor/repository",                                                                                                                                                 
          minimumInputLength: 3,                                                                                                                                                            
          ajax: {                                                                                                                                                                           
              url: "./search_packagist",                                                                                                                                                    
              dataType: 'json',                                                                                                                                                             
              data: function (term, page) {                                                                                                                                                 
                  return {                                                                                                                                                                  
                      name: term                                                                                                                                                            
                  };                                                                                                                                                                        
              },                                                                                                                                                                            
              results: function (data, page) {                                                                                                                                              
                  return {results: data};                                                                                                                                                   
              }                                                                                                                                                                             
          },                                                                                                                                                                                
          formatResult: packageFormatResult,                                                                                                                                                
          formatSelection: packageFormatSelection,                                                                                                                                          
          dropdownCssClass: "bigdrop",                                                                                                                                                      
          escapeMarkup: function (m) { return m; }                                                                                                                                          
      });                                                                                                                                                                                   

      function packageFormatResult(package) {                                                                                                                                               
          var markup = "<dt>" + package.id + "</dt><dd>" + package.description + "</dd>";                                                                                                   
          return markup;                                                                                                                                                                    
      }                                                                                                                                                                                     

      function packageFormatSelection(package) {                                                                                                                                            
          return package.id;                                                                                                                                                                
      }                                                                                                                                                                                     

      var lock = function(){                                                                                                                                                                
        $('#spinningSquaresG').show();                                                                                                                                                      
          $('.prettyprint').each(function(idx, el){                                                                                                                                         
              $(el).addClass('grey-text');                                                                                                                                                  
          });                                                                                                                                                                               
          $('.spinned').each(function(idx, el){                                                                                                                                             
              $(el).fadeOut();                                                                                                                                                              
          });                                                                                                                                                                               
      };                                                                                                                                                                                    

      var unlock = function(){                                                                                                                                                              
          $('#spinningSquaresG').hide();                                                                                                                                                    
          setTimeout(function(){                                                                                                                                                            
              $('.prettyprint').each(function(idx, el){                                                                                                                                     
                  $(el).removeClass('grey-text');                                                                                                                                           
              });                                                                                                                                                                           
              $('.spinned').each(function(idx, el){                                                                                                                                         
                  $(el).fadeIn(1500);                                                                                                                                                       
              });                                                                                                                                                                           
          },200);                                                                                                                                                                           

      };                                                                                                                                                                                    

      var generateSnippets = function(snippets_raw_data){                                                                                                                                   
              $.each(snippets_raw_data, function(idx, snippet){                                                                                                                             
                      $('#' + idx + '_markdown').html(snippet.markdown);                                                                                                                    
                      $('#' + idx + '_img').attr('src', snippet.img);                                                                                                                       
              });                                                                                                                                                                           
      };                                                                                                                                                                                    

      $('#generate').click(function(){                                                                                                                                                      

          lock();                                                                                                                                                                           

          $.ajax({                                                                                                                                                                          
                  url: $('#generate-form').attr('action'),                                                                                                                                  
                  data: $('#generate-form').serialize(),                                                                                                                                    
                  success: function(data){                                                                                                                                                  
                      generateSnippets(data);                                                                                                                                               
                      unlock();                                                                                                                                                             
                  },                                                                                                                                                                        
                  statusCode: {                                                                                                                                                             
                      404: function() {                                                                                                                                                     
                          alert("Repository not found!");                                                                                                                                   
                          unlock();                                                                                                                                                         
                      },                                                                                                                                                                    
                      500: function() {                                                                                                                                                     
                          alert("Repository not found!");                                                                                                                                   
                          unlock();                                                                                                                                                         
                      }                                                                                                                                                                     
                  }                                                                                                                                                                         
          });                                                                                                                                                                               

          return false;                                                                                                                                                                     

      });                                                                                                                                                                                   

  });  

permalink disappear when a new search is done

when a new search is done, the permalink of the repository disappears.

There's a javascript at /src/PUGX/BadgeBundle/Resources/public/js/snippet.js

that replaces the content of an h2 deleting the permalink.

Add the possibility to click on the badge

As subject suggests, it'd was cool if the badge would be a link directed to the pugx's page.
In this way an user interested to apply a badge for his project, could find an easy way to generate his own.
In particular, the page linked by the bedges will point to a page (in pugx.io site) with all the statistics information we have about the project but as addiction it'll be a link create you own badge where the user can view the links for his designed project.

remove show button

Showing the badges of a repository by a new search, could be made automatically without the on click action.

maybe @hpatoio could suggest a solution.

Controller, service definition

as @garak suggested,
should be great instantiate the controller as a service by passing the argument to the construct and the request in the actions.

[RFC] Unstable repository

What to do with all the repositories that doesn't have the stable version?

Now: Daily Downloads

As @leopro said we could print a yellow image (instead blue)
with the latest dev version, instead of stable the word: dev

[story][RFC] v2.0 celebrating the 10 milion badges rendered

In about 20/25 days the number of rendered badges will reach the glorious number of 10.000.000.

In order to celebrate this great number, could be great introduce some love:

objective of 2.0: Copy snippet to clipboard, better search for a package, package perma-link.

  • Copy snippet to clipboard as #85.
  • improve package search similar to packagist search #86.
  • show in homepage the number of total badges rendered #87
  • improve readability on unstable #81

Use Shields to generate badges

The current badges seem a little "out of place" with all the other ones. It'd be great if they were generated with Shields to unify their styles with Travis's, Gittip's and Scrutinizer's, etc. :

badges

[RFC] Show statistics

When the #39 will be approved,
we'll have

  1. total number of badges showed.
  2. given a repository for example "pugx/badge-poser".
    1. total number of badges showed for this repo.
    2. total number of badges showed for each type for this repo.
  3. a set of last repositories that requested the badges.

The questions: how, where and what shows?

collect usage statistics

quite big task,
I was thinking that could be great adding a sort of counter (maybe with redis) in order to store statistic on usage.

not found repos are logged in stats

when I did the tests of the stats I noticed that when a wrong repo is requested the stats function is called.

For example during the test \PUGX\BadgeBundle\Tests\Controller\BadgeControllerTest::testIfPackageDoesntExist the stats are called with the used wrong repo name.

Is this a desired behaviour?

Homepage, Documentation

We need an homepage, in the root of the website
or

  • documentation with readthedocs and rst

or

  • just a simple twig page

Content of the page:

how to add to the badges in your markdown, rst, asciidoc, html ...

The unstable badge is not compatible with git-flow

The unstable version is not compatible with Git Flow, as the branch that is always displayed as unstable is dev master, but Git Flow's unstable branch is dev develop.

Is there a way to specify what the unstable version is or from which branch is the default unstable?

add a JS helper

IPSE DIXIT: "well I guess it could benefit from a touch of JS so you can type a package name and get links ready made for your package."

Copyright and LICENSE

the license and the (c) are with my name.

Is possible put PUGX something?

/*
* This file is part of the badge-poser package
*
* (c) Giulio De Donato <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/ 

Optimization part 2 - API caching

as @giorrrgio and @agiuliano suggested,
now that we have http-caching #18,
we should care about the Packagist Api.

I profiled the application (and the filesystem is so fast compared to the request/response).

Maybe could be great use the LiipCacheBundle in order to store the packagist request/response.

Other ideas? any other that profiled the application? anyone who wants to do this cool task?

favicon

remove the sf favico and add a very poser favicon

lib name

as for other our libs, I suggest using a camelcase name i.e. PUGXBadgePoser

The computation of latest version is flawed

The computation of the latest version is flawed for several reasons:

  • the comparison is done using version_compare, which will not handle dev-master properly as being higher than other versions (so it does not match composer behavior). this is a big issue as the latest unstable version is generally the master branch
  • the code does handle composer branch aliases (so it does not compare the master branch properly even when it is aliased to a comparable version)
  • the stable releases are excluded from the computation of the latest unstable version. But if you allow unstable releases, it does not mean you forbid stable ones. Because of the previous issues, I already saw a project where the latest stable version was 2.3.0 while the latest unstable was 2.3.0-RC1 (so older than 2.3.0)

show in homepage the counter of total badges rendered

show in homepage the number of total badges rendered

could be great having on top pull-left a counter that show the current number of total badges rendered, in redis is STAT.TOTAL

  • Optional the number increase automatically (is possible without ajax?).

badges with higher resolution

to display badges with a higher resolution with the markdown syntax is not possible since it does not allow the width,
but github also allows you to insert html on markdown, so it would be helpful to print badges with higher resolution:

with:

<img src="http://.../ExcelBundle/v/stable.png?size=double" width='100px'>

note:

#97 doesn't allow to create fixed images

Move routes into annotations

I was thinking about the routes.
I think it's better to move them into annotations in controller. This because of the facility to find the correct behaviour in the correct controller without open two files for checking it.
If you agree, I can PR this issue in a short time :)

javascript error

there's an error on the homepage

TypeError: e is not a function
[Break On This Error]   
...options.delay.hide)return n.hide();n.hoverState="out",this.timeout=setTimeout(fu...

Composer package badge

Would be cool to add a new badge that had something like:

composer | phpunit/phpunit

So that the package name is also apparent and instantly viewable.

Cache the request and the images

we have to think about caching the request to packagist api and limit the images generation in order to avoid to send continously request to packagist api with the same burst of data.

move statistic to an other bundle

I think that statistic shouldn't be on the same bundle of the creation of the badge.

the sub folder here is a smelling point: PUGX/BadgeBundle/Service/Statistic.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.