Skip to content

Instantly share code, notes, and snippets.

View mapsi's full-sized avatar

Angel Psiakis mapsi

View GitHub Profile
@mapsi
mapsi / installing_couchbase_php_extension_centos62.md
Last active December 19, 2015 19:38
Couchbase PHP extension copy-and-paste quickstart for a standard CentOS 6.2 64bit LAMP stack

#Installing Couchbase PHP extension on CentOS 6.2 64bit

Install libraries and stuff

sudo wget -O/etc/yum.repos.d/couchbase.repo http://packages.couchbase.com/rpm/couchbase-centos62-x86_64.repo  
sudo yum check-update  
sudo yum install -y  libcouchbase2 libcouchbase-devel

Install Couchbase extension

@mapsi
mapsi / installing_phalconphp_on_centos62.md
Last active January 15, 2022 06:00
Copy-Paste documentation of how to install phalcon on Phalcon on CentOS 6.2

#Installing Phalcon on CentOS 6.2 64bit

Install build tools

sudo yum install gcc make  
sudo yum install php-devel  

Compile Phalcon

@mapsi
mapsi / Testing_model_static_methods_in_controller_actions.md
Last active December 23, 2015 10:49
Testing model static methods in controller actions

Testing model static methods in controller actions

Imagine we have a model called Accounts which contains a static find() method.

class Accounts extends MyModel
{
    public static function find($param)
    {
        // ...
@mapsi
mapsi / .bashrc
Last active February 22, 2016 06:39
My .bashrc for Mac OSX 10.9.1
## Colorize the ls output ##
alias ls='ls -G'
## Use a long listing format ##
alias ll='ls -la'
## Show hidden files ##
alias l.='ls -d .*'
## Colorize the grep command output for ease of use (good for log files)##
@mapsi
mapsi / array2table.js
Created February 11, 2014 17:41
Convert JS array to HTML table
// build HTML table data from an array (one or two dimensional)
function generateTable(data) {
var html = '';
if (typeof (data[0]) === 'undefined') {
return null;
}
if (data[0].constructor === String) {
html += '<tr>\r\n';
@mapsi
mapsi / gist:44d2f5d6ccecd5943856
Created May 28, 2014 09:20
git configuration
git config --global push.default simple
git config --global branch.autosetuprebase always
git config --global pull.rebase true
@mapsi
mapsi / gist:91f72ed08dc48c929aab
Created December 11, 2014 15:00
Find tables that have a referential constraint on a table_name
SELECT *
FROM information_schema.REFERENTIAL_CONSTRAINTS
WHERE REFERENCED_TABLE_NAME = 'table_name'
AND CONSTRAINT_SCHEMA='scheman_name';
@mapsi
mapsi / docker-compose.yml
Created July 29, 2017 03:44 — forked from wojas/docker-compose.yml
docker-compose for nginx with php5-fpm using small alpine images
version: '2'
services:
php:
image: php:5.6-fpm-alpine
volumes:
- data:/_data
- ./site:/var/www/html:ro
networks:
- backend
command: sh -c 'chown www-data /_data && exec php-fpm'
@mapsi
mapsi / .env.gitlab
Created July 29, 2017 11:41
Laravel Dusk (PHPUNIT) Test for Gitlab-ci with docker chromdriver , headless chrome, vnc, screenshots, pipeline, artifacts
APP_ENV=testing
APP_KEY=base64:DimZ0aVNA8ZWtWxTB4fDxFc6lL1wM2C7evETA4QK3+c=
APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost:8081
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=secca_testing
@mapsi
mapsi / .codeclimate.yml
Created July 19, 2019 10:31
Codeclimate PHP config for Laravel projects
---
version: "2"
plugins:
# https://docs.codeclimate.com/docs/duplication
duplication:
enabled: true
config:
languages:
# - ruby:
# - javascript: