Skip to content

Instantly share code, notes, and snippets.

View zaerl's full-sized avatar
🏠
Working from home

Francesco Bigiarini zaerl

🏠
Working from home
View GitHub Profile
@zaerl
zaerl / bbp-core-filters.php
Created October 13, 2012 12:38
bbPress 1,000 count bug
// add_filter( 'bbp_get_topic_reply_count', 'bbp_number_format', 10 );
add_filter( 'bbp_topic_reply_count', 'bbp_number_format', 10 );
@zaerl
zaerl / bbp-replay-functions.php
Created October 22, 2012 07:42
bbPress FORCE INDEX workaround
function _bbp_has_replies_where( $where, $query ) {
// Bail if no post_parent to replace
if ( ! is_numeric( $query->get( 'post_parent' ) ) )
return $where;
// Bail if not a topic and reply query
if ( array( bbp_get_topic_post_type(), bbp_get_reply_post_type() ) != $query->get( 'post_type' ) )
return $where;
@zaerl
zaerl / functions.php
Created November 16, 2012 09:49
Custom bbPress role names
function my_custom_roles( $role, $user_id, $user_role ) {
if( $role == 'Key Master' )
return 'Site Owner';
return $role;
}
add_filter( 'bbp_get_user_display_role', 'my_custom_roles', 10, 3 );
@zaerl
zaerl / woocsv.js
Last active December 19, 2015 00:09
Add ajaxurl on woocommerce-csvimport admin js file
var d = Date.now();
jQuery(document).ready(function()
{
jQuery('#headerForm').submit(function(e)
{
var saveHeaderForm = jQuery(this).serialize();
jQuery.ajax(
{
type: "POST",
url: ajaxurl,
@zaerl
zaerl / keybase.md
Created March 25, 2014 13:49
keybase.md

Keybase proof

I hereby claim:

  • I am zaerl on github.
  • I am zaerl (https://keybase.io/zaerl) on keybase.
  • I have a public key whose fingerprint is 8004 AB38 C43D F240 3375 04AB 49FA 7BE5 F27C B464

To claim this, I am signing this object:

# Get all .c files from src/ directory
SRCS = $(shell find $(SRC_DIR) -type f -name "*.c")
# Generate corresponding .o file names
OBJS = $(patsubst $(SRC_DIR)/%, $(BUILD_DIR)/%, $(SRCS:.c=.o))
% brew info cmake
Warning: Treating cmake as a formula. For the cask, use homebrew/cask/cmake
==> cmake: stable 3.28.3 (bottled), HEAD
Cross-platform make
https://www.cmake.org/
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/c/cmake.rb
License: BSD-3-Clause
==> Options
--HEAD
% cmake --version
cmake version 3.28.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
cmake_minimum_required(VERSION 3.0)
project(MyProject)
# Add all .c files in the src directory to the list of source files
file(GLOB SOURCES "src/*.c")
# Include the headers directory
include_directories("src")
# Create the executable target
ATT_ASSERT(VALUE, EXPECTED, "A brief description")