Skip to content

Instantly share code, notes, and snippets.

View reactormade's full-sized avatar

Reactormade reactormade

View GitHub Profile
<?php
//If you just see a blank page instead of an error reporting and you have no server access so you can't edit php configuration files like php.ini try this:
// create a new file in which you include the faulty script:
error_reporting(E_ALL);
ini_set("display_errors", 1);
include("file_with_errors.php");
// execute this file instead of the faulty script file
@reactormade
reactormade / error_reporting.php
Last active December 15, 2015 02:19
Do not report E_ALL errors since 5.4.0 E_STRICT became part of E_ALL. http://php.net/manual/en/function.error-reporting.php
<?php
error_reporting(E_ERROR | E_PARSE | E_NOTICE);
?>
@reactormade
reactormade / box-sizing.css
Created December 29, 2013 20:18
Apply a natural box layout model to all elements
/*
* apply a natural box layout model to all elements
* http://www.paulirish.com/2012/box-sizing-border-box-ftw/
*/
*, *:before, *:after {
-moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;
}
/**
* RETORNA URL DO POST_THUMBNAIL PARA BACKGROUND-IMAGE
* @param int: get_the_ID()
* @param string: thumbnail, medium, large, full
**/
function post_thumbnail_url($post_id, $size = 'thumbnail'){
$thumb = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), $size );
$url = $thumb[0];
return $url;
}
@reactormade
reactormade / responsive-facebook-comments.css
Created February 13, 2014 21:02
Responsive Facebook Comments box CSS
.fb_iframe_widget > span {
}
.fb-comments,
.fb-comments iframe[style],
.fb-comments > span {
width: 100% !important;
}
@reactormade
reactormade / remove-touch-delay-ie.css
Created February 19, 2014 18:00
Remove 300ms touch delay in IE
html {
/* Remove 300ms touch delay in IE */
-ms-touch-action: manipulation;
touch-action: manipulation;
}
@reactormade
reactormade / mysql_result_array_to_array_of_objects.php
Created February 22, 2014 14:40
Simple MySQL query result to array of objects conversion
if(!function_exists('converte_query_result_em_array_of_objects')):
/**
* CONVERTE ARRAY DE QUERY RESULT
* EM ARRAY DE OBJETOS PARA ACESSO DIRETO
**/
function converte_query_result_em_array_of_objects($array){
if(is_array($array) && is_resource($array)):
$output = array();
while($row = mysql_fetch_assoc($array)): $output[] = (object)$row; endwhile;
return $output;
@reactormade
reactormade / variables_get_template_part.php
Created April 27, 2014 23:54
Passing variables to get_template_part() in WordPress
include(locate_template('your-template-name.php'));
//original here: http://keithdevon.com/passing-variables-to-get_template_part-in-wordpress/
@reactormade
reactormade / gist:6cf353acf2782db01317
Last active August 29, 2015 14:02
Git ignore sass-cache
**/.sass-cache
**/.sass-cache/*
**.sass-cache**