Skip to content

Instantly share code, notes, and snippets.

View pietromalerba's full-sized avatar

Pietro Malerba pietromalerba

  • M3
  • Civitanova Marche (MC) - Italy
View GitHub Profile
<?php
include "facebook/facebook.php";
$facebook = new Facebook( array( 'appId' => APP_ID, 'secret' => APP_SECRET ) );
// enable upload support
$facebook->setFileUploadSupport( true );
// set access token for user / page here (not needed if you intend to use the login flow beforehand)
<?php
// include Facebook PHP SDK
include "facebook/facebook.php";
// init Facebook SDK with app settings
$facebook = new Facebook( array( 'appId' => APP_ID, 'secret' => APP_SECRET ) );
// enable file upload support
$facebook->setFileUploadSupport( true );
<?php
// place and run in ./plugins/bbpress/bbp-themes
$dirs = array( './bbp-twentyten', './bbp-twentyten/bbpress' );
$actions = array();
$filters = array();
<?php
// get next and prev products
// Author: Georgy Bunin ([email protected])
// forked from https://gist.github.com/2176823
function ShowLinkToProduct($post_id, $categories_as_array, $label) {
// get post according post id
$query_args = array( 'post__in' => array($post_id), 'posts_per_page' => 1, 'post_status' => 'publish', 'post_type' => 'product', 'tax_query' => array(
array(
'taxonomy' => 'product_cat',
@pietromalerba
pietromalerba / guida_taglie_girogama.html
Created August 4, 2015 09:37
Guida Taglie Girogama
<div class="clearfix"></div>
<!-- Guidataglie Section -->
<section class="success" id="guidataglie">
<div class="container">
<div class="row">
<div class="col-lg-10 text-center">
<h2>Guida Taglie</h2>
<hr class="star-light">
</div>
</div>
@pietromalerba
pietromalerba / gulfile.js
Last active August 26, 2015 14:54 — forked from miziomon/gulfile.js
my gulp config
/*
* https://github.com/gulpjs/gulp
* http://code.tutsplus.com/tutorials/using-gulp-for-wordpress-automation--cms-23081
* https://markgoodyear.com/2014/01/getting-started-with-gulp/
* http://mattbanks.me/gulp-wordpress-development/
*
*/
var gulp = require('gulp'),
through = require('gulp-through'),
@pietromalerba
pietromalerba / functions.php
Last active September 7, 2015 18:10 — forked from goliver79/functions.php
[WOOCOMMERCE] Get category thumbnail without resize
<?php
/*
* @goliver: overwrite function for get category thumbnail size without resize
* original in woocommerce-template.php
*/
function woocommerce_subcategory_thumbnail( $category ) {
global $woocommerce;
$small_thumbnail_size = apply_filters( 'single_product_small_thumbnail_size', 'shop_catalog' );
$dimensions = $woocommerce->get_image_size( $small_thumbnail_size );
@pietromalerba
pietromalerba / functions.php
Created January 10, 2016 18:02 — forked from sardbaba/functions.php
Wordpress - List all hooks
//LIST ALL HOOKS
function dump_hook( $tag, $hook ) {
ksort($hook);
echo "<pre>>>>>>\t$tag<br>";
foreach( $hook as $priority => $functions ) {
echo $priority;
@pietromalerba
pietromalerba / rushi.txt
Created September 17, 2016 15:33 — forked from rushipkar90/rushi.txt
rushi.txt
prestashop - 500 error
===================
https://www.prestashop.com/forums/topic/421126-request-exceeded-the-limit-of-10-internal-redirects-due-to-probable-configuration-error/
===================
CloudFlare installation:
==========
http://www.cpanelkb.net/cloudflare-plugin-install/
http://crybit.com/install-cloudflare-plugin-on-cpanel/
http://stackoverflow.com/questions/23860877/how-to-install-cloudflare-on-cpanel-servers
@pietromalerba
pietromalerba / ngnix.md
Last active November 11, 2016 17:11 — forked from magnetikonline/README.md
Ngnix configuration

Nginx FastCGI response buffer sizes

By default when Nginx starts receiving a response from a FastCGI backend (such as PHP-FPM) it will buffer the response in memory before delivering it to the client. Any response larger than the set buffer size is saved to a temporary file on disk. This process is outlined at the Nginx ngx_http_fastcgi_module page document page.

Introduction

Since disk is slow and memory is fast the aim is to get as many FastCGI responses passing through memory only. On the flip side we don't want to set an excessively large buffer as they are created and sized on a per request basis (i.e. it's not shared memory).