Skip to content

Instantly share code, notes, and snippets.

Avatar

Morgan Brunot oziks

  • Tours
View GitHub Profile
@oziks
oziks / IconComponent.js
Created Jan 4, 2018
Build SVG Icon components with React (bicolor and fade state)
View IconComponent.js
import { Component } from 'react';
import PropTypes from 'prop-types';
class IconComponent extends Component {
render() {
const { size, faded } = this.props;
const colors = {
primaryColor: faded ? '#dfdfe7' : '#00cc99',
secondaryColor: faded ? '#dfdfe7' : '#f5a623',
@oziks
oziks / index.js
Created Aug 23, 2017
BetaSeries api redux sdk runner
View index.js
// use babel-register to precompile ES6 syntax
require('babel-register')({
ignore: /node_modules/,
});
require('isomorphic-fetch');
require('./test');
View index.jsx
import React, { Component } from 'react';
import { StyleSheet, View, Image, Text } from 'react-native';
const styles = StyleSheet.create({
loaderSplashView: {
backgroundColor: BSColors.navBar,
flex: 1,
flexDirection: 'column',
alignItems: 'center',
justifyContent: 'center',
View BasePage.php
<?php
namespace FeatureContext\Page;
use SensioLabs\Behat\PageObjectExtension\PageObject\Page;
class BasePage extends Page
{
/**
View Repository.php
<?php
namespace M6\Helpers\Bundle\ORMBundle\Repository;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
/**
* Repository class
@oziks
oziks / Entity.php
Created Sep 17, 2013
Validate Symfony Form Type with Entity method
View Entity.php
<?php
....
/**
* Validate Method
*
* @param ExecutionContext $context Execution context
*
* @return void
*/
public function validateMethod(ExecutionContext $context)
@oziks
oziks / pre-commit.sh
Last active Dec 14, 2015
pre-commit hook (atoum - propel migration - PHP CS)
View pre-commit.sh
#!/bin/bash
#pre-commit
function abort() {
echo -e "\n\terror: Commit abort"
echo -e "\t$1"
exit 1
}
echo $(tput bold)$(tput setaf 5)"Running pre-commit hook..."$(tput sgr0)
@oziks
oziks / demo.php
Last active Aug 3, 2018
flatten php function via http://ideone.com/1dBqx
View demo.php
<?php
$data = array(
'user' => array(
'email' => 'user@example.com',
'name' => 'Super User',
'address' => array(
'billing' => 'Street 1',
'delivery' => 'Street 2'
)
@oziks
oziks / contains.js
Created Sep 7, 2012
jQuery contains selector insensitive (case and accented characters)
View contains.js
jQuery.expr[':'].contains = function(a, i, m) {
var rExps=[
{re: /[\xC0-\xC6]/g, ch: "A"},
{re: /[\xE0-\xE6]/g, ch: "a"},
{re: /[\xC8-\xCB]/g, ch: "E"},
{re: /[\xE8-\xEB]/g, ch: "e"},
{re: /[\xCC-\xCF]/g, ch: "I"},
{re: /[\xEC-\xEF]/g, ch: "i"},
{re: /[\xD2-\xD6]/g, ch: "O"},
{re: /[\xF2-\xF6]/g, ch: "o"},