Skip to content

Instantly share code, notes, and snippets.

View inalgnu's full-sized avatar
:bowtie:
It's a great day to be alive

Inel inalgnu

:bowtie:
It's a great day to be alive
View GitHub Profile
@inalgnu
inalgnu / array.php
Last active August 29, 2015 14:26
PHP WTF || it's me
<?php
$a = ['a' => '100', 'b' => '200', 'c' => '300'];
$b = ['100' => 'a', '200' => 'b', '300' => 'c'];
dump($b);
//array:3 [
// 100 => "a"
// 200 => "b"
// 300 => "c"
@inalgnu
inalgnu / gist:9112814
Created February 20, 2014 12:51
Install php with brew and somme other configs
brew tap homebrew/dupes
brew tap josegonzalez/homebrew-php
brew install php54 --with-mysql --with-pgsql --with-xdebug
brew install php54-intl
brew install php54-mcrypt
export PATH="$(brew --prefix josegonzalez/php/php54)/bin:$PATH" in your ~/.zshrc
Utf terminal problem
@inalgnu
inalgnu / fix-permission.sh
Last active August 29, 2015 13:56
Fix Symfony2 directories permissions
#!/bin/sh
USER=$(whoami)
APACHE_USER=$(ps axho user,comm|grep -E "httpd|apache"|uniq|grep -v "root"|awk 'END {print $1}')
sudo chmod +a "$USER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
sudo chmod +a "$APACHE_USER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs
echo "app/cache & app/logs been properly chmod'ed for $USER and $APACHE_USER"
@inalgnu
inalgnu / gist:8966181
Created February 12, 2014 22:51
Handle undefined index error
<?php
set_error_handler('undefinedIndexHandler');
function undefinedIndexHandler($errno, $errstr, $errfile, $errline, $errcontext)
{
if (!preg_match('/Undefined index/', $errstr)) {
return;
}
@inalgnu
inalgnu / gist:7787023
Created December 4, 2013 12:55
Gist de la présentation de ce midi sur les forms Angularjs
<html>
<head>
<title>Angular App</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css">
<style type="text/css">
input {margin:10px ;}
input.ng-invalid.ng-dirty {
border-color: red;
}
input.ng-valid.ng-dirty {
@inalgnu
inalgnu / LICENSE
Created August 14, 2012 07:51 — forked from irae/LICENSE
Auto-growing textareas with jQuery — The perfectionist way
MIT License
===========
Copyright (c) 2009–2011
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@inalgnu
inalgnu / .gitignore
Created July 26, 2012 13:47 — forked from weaverryan/.gitignore
sample Symfony2 .gitignore
web/bundles/
app/bootstrap*
app/cache/*
app/logs/*
vendor/
app/config/parameters.ini