Skip to content

Instantly share code, notes, and snippets.

View neilime's full-sized avatar

Emilien Escalle neilime

View GitHub Profile
@neilime
neilime / repository-checklist.md
Last active October 10, 2019 16:29
Repository checklist
@neilime
neilime / react-app-typescript-boilerplate-lighthouse.json
Created June 12, 2019 20:32
React app typescript boilerplate lighthouse report
{"userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36","environment":{"networkUserAgent":"Mozilla/5.0 (Linux; Android 6.0.1; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3694.0 Mobile Safari/537.36 Chrome-Lighthouse","hostUserAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36","benchmarkIndex":760},"lighthouseVersion":"4.2.0","fetchTime":"2019-06-12T20:13:00.513Z","requestedUrl":"https://react-app-typescript-boilerplate.netlify.com/","finalUrl":"https://react-app-typescript-boilerplate.netlify.com/","runWarnings":[],"audits":{"is-on-https":{"id":"is-on-https","title":"Uses HTTPS","description":"All sites should be protected with HTTPS, even ones that don't handle sensitive data. HTTPS prevents intruders from tampering with or passively listening in on the communications between your app and your users, and is a prerequisite for HTTP/2
@neilime
neilime / travis_ci_php_publish_build.sh
Last active October 8, 2019 18:10
Bash script used by travis ci as an after script to publish build info on wiki an gh-pages
#!/bin/bash
# Create a token in https://github.com/settings/tokens with "public_repo" permission
# Generate a secure token : "travis encrypt -r username/reponame GH_TOKEN=xxx --add;" (https://docs.travis-ci.com/user/encryption-keys/)
# Put the result in the ".travis.yml" file :
# env:
# global:
# - secure: ...
set -e # Exit with nonzero exit code if anything fails
@neilime
neilime / TwbBundleFormElement.php
Created February 5, 2014 13:32
Override TwbBundle\Form\View\Helper\TwbBundleFormElement
<?php
namespace Test\Form\View\Helper;
class TestTwbBundleFormElement extends \TwbBundle\Form\View\Helper\TwbBundleFormElement
{
/**
* Render an element
* @param \Zend\Form\ElementInterface $oElement
* @return string
*/
@neilime
neilime / ExempleFormRow.php
Created February 18, 2013 13:42
Exemple overriding FormRow Helper for adding "required" class to element's label if it has required attribute
<?php
/**
* This class ovveride FormRow view helper
* The file should be in "module/Application/src/Application/Form/View/Helper" directory
*/
namespace Application\Form\View\Helper;
class ExempleFormRow extends \TwbBundle\Form\View\Helper\TwbBundleFormRow{
public function render(\Zend\Form\ElementInterface $oElement){
if($oElement->getAttribute('required') === true){
$aLabelAttributes = $oElement->getLabelAttributes()?:$this->labelAttributes;
$form = new \Zend\Form\Form();
$form->add(array(
'name' => 'test_file_input',
'type' => 'Zend\Form\Element\File'
));
$inputFilter = new \Zend\InputFilter\InputFilter();
$inputFilter->add(array(
'name' => 'test_file_input',
'required' => true,