Skip to content

Instantly share code, notes, and snippets.

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

Maxwell maxjf1

🏠
Working from home
  • UFJF
  • Juiz de Fora, Minas Gerais - Brazil
View GitHub Profile
@mikaelbr
mikaelbr / destructuring.js
Last active February 20, 2025 13:00
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@alana-mullen
alana-mullen / Detect the last post in the WordPress loop
Last active May 29, 2023 16:50
Detect the last post in the WordPress loop
<?php if (($wp_query->current_post +1) == ($wp_query->post_count)) {
echo 'This is the last post';
} ?>
<?php if (($wp_query->current_post +1) != ($wp_query->post_count)) {
echo 'This is the not the last post';
} ?>