Skip to content

Instantly share code, notes, and snippets.

View lamsmallari's full-sized avatar
💭
🌳

Lam lamsmallari

💭
🌳
View GitHub Profile
@charleslouis
charleslouis / custom-search-acf-wordpress.php
Last active March 8, 2026 03:04
PHP - Wordpress - Search - wordpress custom search function that encompasses ACF/advanced custom fields and taxonomies and split expression before request
<?php
/**
* [list_searcheable_acf list all the custom fields we want to include in our search query]
* @return [array] [list of custom fields]
*/
function list_searcheable_acf(){
$list_searcheable_acf = array("title", "sub_title", "excerpt_short", "excerpt_long", "xyz", "myACF");
return $list_searcheable_acf;
}
@Webcreations907
Webcreations907 / example.php
Last active September 23, 2025 09:55
Example VC Nesting
<?php
/************************************************************************
* Example Nested For VC
* vc_map() stuff should only be included when VC is enabled.
*
* This is just for a copy/paste test purpose.
*************************************************************************/
@abhisekp
abhisekp / FCC Bonfire - Where art thou Solutions.md
Last active February 1, 2017 22:16
Bonfire - Where art thou Solutions - FreeCodeCamp

Many of the solutions available around the internet for Bonfire: Where art thou are quite not right even if they pass the tests in FreeCodeCamp (FCC) because they don't adhere to the instructions completely.

  • Disclaimer: Please don't look into the solutions if you've not solved it yourself.

Bonfire Instruction:-

Make a function that looks through a list (first argument) and returns an array of all objects that have equivalent property values (second argument).


Here are two solutions that exactly adhere to the instructions given in the Bonfire Challenge.

<?php
/**
* Get all type posts
*
* @return void
* @author alispx
**/
function alispx_get_type_posts_data( $post_type = 'post' ) {
@dom082186
dom082186 / custom-css.css
Last active October 25, 2015 06:53
Custom CSS Framework
@import url(https://fonts.googleapis.com/css?family=Open+Sans:400,700);@import url(https://maxcdn.bootstrapcdn.com/font-awesome/4.4.0/css/font-awesome.min.css);.full-container{width:100%}.fixed-container{margin:0 auto;padding:0 15px}.column-container{font-size:0}.column{font-size:14px;padding:0 15px;vertical-align:top;display:inline-block}.xs-full{width:100%}.xs-one-half{width:50%}.xs-one-third{width:33.3333333333%}.xs-two-third{width:66.6666666667%}.xs-one-fourth{width:25%}.xs-two-fourth{width:50%}.xs-three-fourth{width:75%}.xs-one-fifth{width:20%}.xs-two-fifth{width:40%}.xs-three-fifth{width:60%}.xs-four-fifth{width:80%}.xs-one-sixth{width:16.6666666667%}.xs-two-sixth{width:33.3333333333%}.xs-three-sixth{width:50%}.xs-four-sixth{width:66.6666666667%}.xs-five-sixth{width:83.3333333333%}.xs-one-seventh{width:14.2857142857%}.xs-two-seventh{width:28.5714285714%}.xs-three-seventh{width:42.8571428571%}.xs-four-seventh{width:57.1428571429%}.xs-five-seventh{width:71.4285714286%}.xs-six-seventh{width:85.7142857143%}
@dom082186
dom082186 / query.php
Created October 8, 2015 07:56
WP Query
?>
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$query = new WP_Query(array(
'post_type' => 'business_partners',
'posts_per_page' => -1,
'orderby' => 'title',
'order' => 'ASC',
@ccurtin
ccurtin / Detect-if-IE.js
Created November 23, 2015 06:41
Detect if IE and add class to html/body..
/**
* detect IE
* returns version of IE or false, if browser is not Internet Explorer
*/
(function detectIE() {
var ua = window.navigator.userAgent;
var msie = ua.indexOf('MSIE ');
if (msie > 0) {
@alirezas
alirezas / fade.js
Created February 13, 2017 10:54
fadeIn & fadeOut in vanilla js
function fadeOut(el){
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= .1) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();
@bradtraversy
bradtraversy / pdocrash.php
Last active November 11, 2025 12:29
PDO & Prepared Statements Snippets
<?php
$host = 'localhost';
$user = 'root';
$password = '123456';
$dbname = 'pdoposts';
// Set DSN
$dsn = 'mysql:host='. $host .';dbname='. $dbname;
// Create a PDO instance
@toraritte
toraritte / add_user_and_reset_password_with_Firebase_admin_on_node.md
Last active May 10, 2024 13:10
Sending password reset email after user has been created with Firebase Admin SDK (Node.js)

Sending password reset email after user has been created with Firebase Admin SDK (Node.js)

1. Install Firebase's Node modules

Install the Firebase Node modules:

$ npm install firebase firebase-admin --save