Skip to content

Instantly share code, notes, and snippets.

View oziks's full-sized avatar

Morgan Brunot oziks

View GitHub Profile
@oziks
oziks / contains.js
Created September 7, 2012 10:00
jQuery contains selector insensitive (case and accented characters)
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"},
@oziks
oziks / demo.php
Last active August 3, 2018 10:10
flatten php function via http://ideone.com/1dBqx
<?php
$data = array(
'user' => array(
'email' => '[email protected]',
'name' => 'Super User',
'address' => array(
'billing' => 'Street 1',
'delivery' => 'Street 2'
)
@oziks
oziks / pre-commit.sh
Last active December 14, 2015 11:50
pre-commit hook (atoum - propel migration - PHP CS)
#!/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 / Entity.php
Created September 17, 2013 07:32
Validate Symfony Form Type with Entity method
<?php
....
/**
* Validate Method
*
* @param ExecutionContext $context Execution context
*
* @return void
*/
public function validateMethod(ExecutionContext $context)
<?php
namespace M6\Helpers\Bundle\ORMBundle\Repository;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
/**
* Repository class
<?php
namespace FeatureContext\Page;
use SensioLabs\Behat\PageObjectExtension\PageObject\Page;
class BasePage extends Page
{
/**
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',
@oziks
oziks / index.js
Created August 23, 2017 13:58
BetaSeries api redux sdk runner
// use babel-register to precompile ES6 syntax
require('babel-register')({
ignore: /node_modules/,
});
require('isomorphic-fetch');
require('./test');
@oziks
oziks / IconComponent.js
Created January 4, 2018 11:14
Build SVG Icon components with React (bicolor and fade state)
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 / Button.vue
Created May 7, 2024 18:32
Vuetify v3 component override. Example here with VBtn
<script setup lang="ts">
import { computed } from 'vue'
import { VBtn } from 'vuetify/components'
type VBtnProps = InstanceType<typeof VBtn>['$props']
interface Props extends /* @vue-ignore */ Omit<VBtnProps, 'variant' | 'color'> {
variant: 'primary' | 'secondary'
}