Skip to content

Instantly share code, notes, and snippets.

View liverbool's full-sized avatar

Ishmael Dos liverbool

  • Earth
View GitHub Profile
var fs = require("fs");
var dir = __dirname+"/functions";
/**
* Build packages by you want.
* Added by ツ Liverbool
*
* List of packages
* @see https://github.com/kvz/phpjs/tree/master/functions
@liverbool
liverbool / doctrine.function.convert.using.php
Last active December 21, 2015 18:09
MySql Convert Charset: CONVERT(... USING ...) for Doctrine 2
<?php
namespace Entities\meta\Functions;
use Doctrine\ORM\Query\Lexer;
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
/**
* "CONVERT" "(" ArithmeticPrimary AliasResultVariable AliasResultVariable ")".
* More info:
* http://dev.mysql.com/doc/refman/5.0/en/cast-functions.html#function_convert
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
http://askubuntu.com/questions/14763/where-are-the-apache-and-php-log-files
Check this settings in PHP.INI:
error_reporting = E_ALL | E_STRICT (as recommended for development in php.ini)
error_log = /var/log/php_errors.log
Then create log file manually
touch /var/log/php_errors.log
@liverbool
liverbool / JP-Acl.php
Created February 20, 2014 12:42
Sample Acl
<?php
namespace JP\Authen;
/**
* we are start with deny concept
* all usergroup init with deny (not allow)
*
* mulitple usergroup
* allow + allow = allow
* deny + deny = deny
<?php
/**
* See also {
@link http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
@link http://mirror.neu.edu.cn/mysql/tech-resources/articles/hierarchical-data.html
@link http://www.sitepoint.com/hierarchical-data-database-2/
* }
*/
class JTreeTable extends JObject
{
@liverbool
liverbool / phpmyadmin
Created March 2, 2014 17:10
ubuntu 13 phpmyadmin up/down
#!/bin/bash
currentdir=`echo $PWD`
if [ "$1" = "up" ];then
cd /etc/apache2/conf-enabled/
ln -s -T /etc/apache2/conf-available/phpmyadmin.conf phpmyadmin.conf
service apache2 reload
else if [ "$1" = "down" ];then
rm /etc/apache2/conf-enabled/phpmyadmin.conf
@liverbool
liverbool / 0_reuse_code.js
Created March 3, 2014 14:47
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@liverbool
liverbool / BuildAttributeFormChoicesListener.php
Created October 9, 2014 18:01
fix sylius form attribute choice.
<?php
namespace BugFix\Sylius\CoreBundle\Form\Type;
use Sylius\Component\Attribute\Model\AttributeTypes;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\Form\FormFactoryInterface;
class BuildAttributeFormChoicesListener implements EventSubscriberInterface