Skip to content

Instantly share code, notes, and snippets.

@hiryu85
hiryu85 / response.json
Created June 19, 2018 14:45
response_event.json
{
"time": 1529411499,
"status": "success",
"result": {
"config": {
//
"image_generator_url": {
"resize_w" : "http://app.castellodelnero.com/phpthumbsup/w/[width]/src/[src]",
"resize_h" : "http://app.castellodelnero.com/phpthumbsup/h/[height]/src/[src]",
{
"time": 1529411499,
"status": "success",
"result": {
"config": {
"future": null
},
"content": {
@hiryu85
hiryu85 / StoreProductCategoriesController.php
Last active June 19, 2017 14:20
TreeBehavior spacer char callback: i want add character only to end (no repeat)
public function add() { 
// ....
$parentCategories = $this->StoreProductCategories->ParentStoreCategories->find('treeList', [
// Current output:
//
// Root Category
// ↳ Shoes (level 1)
// ↳↳ Nike (level 2)
//
@hiryu85
hiryu85 / apache_create_vhost.sh
Created August 30, 2016 16:44
Crea nuovo virtual host
#!/bin/sh
# Crea nuovo virtual host
# Autore: Chialastri Mirko <chialastri.mirko@gmail.com>
# Configuration
VHOST_BASE="/Users/Hiryu/Apps"
APACHE_VHOST_ROOT="/etc/apache2"
# End Configuration
@hiryu85
hiryu85 / bashrc
Last active September 28, 2015 16:44
Configurazione Apache con FastCGI con più
alias apache_start="sudo apachectl start"
alias apache_stop="sudo apachectl stop"
alias apache_restart="sudo apachectl restart"
alias apache_config="sudo $EDITOR /usr/local/etc/apache2/2.4/httpd.conf"
alias apache_config_check="sudo apachectl -t"
alias apache_vhost="sudo $EDITOR /etc/apache2/extra/httpd-vhosts.conf"
alias apache_php_fm_config="sudo $EDITOR /etc/apache2/other/fastcgi_factory.conf"
# WebServer
alias conf_httpd="sudo $EDITOR /usr/local/etc/apache2/2.4/httpd.conf"
@hiryu85
hiryu85 / FacebookGallery.class.php
Last active May 4, 2020 12:39
Facebook albums with Graph API and PHP
<?php
/**
* Facebook albums
*
* @example FacebookGallery::albums(PAGE_ID, ACCESS_TOKEN, CACHE_DURATION)
*/
Class FacebookGallery {
const FB_ALBUM_MAX_JSON_DEPTH = 1000;
const FB_ALBUM_TMP = './tmp/cache/facebook';