Skip to content

Instantly share code, notes, and snippets.

View yumyo's full-sized avatar

Giulia Nicole Pernice yumyo

View GitHub Profile
@natelandau
natelandau / .bash_profile
Last active May 12, 2025 15:55
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@wturrell
wturrell / popular-posts.php
Created March 14, 2014 12:33
Wordpress & Google Analytics - retrieve most popular posts
@chriskoelle
chriskoelle / nh-oembed.php
Last active December 15, 2015 19:43
Wordpress oEmbed Customizations
<?php
/**
* Clear oEmbed Cache on save
* this is necessary in order to update the oembed output
*/
function nh_clear_oembed_caches($post_id) {
if ( wp_is_post_revision( $post_id ) ) return;
global $wp_embed;
$wp_embed->delete_oembed_caches($post_id);
}
@fardog
fardog / functions.php
Last active February 5, 2017 19:46
A function for sending Wordpress Advanced Custom Fields (ACF) Repeater Field, Flexible Content Field, Gallery Field data with Thermal API.
<?php
function north_cast_api_data($content) {
if (is_numeric($content)) $content = intval($content);
else {
$unserialized_content = @unserialize($content);
// we got serialized content
if ($unserialized_content !== false) {
// make sure that integers are represented as such, instead of str
foreach ($unserialized_content as $fn => &$c) {
@trajche
trajche / functions.php
Last active December 22, 2023 10:54
Remove Yoast SEO version from header
add_action('get_header', 'start_ob');
add_action('wp_head', 'end_ob', 999);
function start_ob() {
ob_start('remove_yoast');
}
function end_ob() {
ob_end_flush();
}
@hereswhatidid
hereswhatidid / clean-walker.php
Last active February 5, 2021 16:14
WordPress nav walker that strips the WP generated styles and IDs from the generated output.
<?php
class Clean_Walker_Nav extends Walker_Nav_Menu {
/**
* Filter used to remove built in WordPress-generated classes
* @param mixed $var The array item to verify
* @return boolean Whether or not the item matches the filter
*/
function filter_builtin_classes( $var ) {
return ( FALSE === strpos( $var, 'item' ) ) ? $var : '';
}
@jchristopher
jchristopher / gist:8558947
Created January 22, 2014 13:44
Tell SearchWP to index author information by adding it to SearchWP's index as postmeta
<?php
function my_searchwp_extra_metadata( $extra_meta, $post_being_indexed ) {
// available author meta: http://codex.wordpress.org/Function_Reference/get_the_author_meta
// retrieve the author's name(s)
$author_nicename = get_the_author_meta( 'user_nicename', $post_being_indexed->post_author );
$author_display_name = get_the_author_meta( 'display_name', $post_being_indexed->post_author );
$author_nickname = get_the_author_meta( 'nickname', $post_being_indexed->post_author );
@leesmith
leesmith / simple-git-workflow.md
Last active December 30, 2023 23:37
Simple Git Workflow For Continuous Delivery

Simple Git Workflow For Continuous Delivery

Workflow guidelines:

  • master branch is always production-ready, deployable, 100% green test suite
  • New development is done on feature branches, with frequent rebasing onto master
  • Clean commit history by preferring to rebase instead of merge (git pull is configured to automatically rebase)

rebase workflow

Workflow

@andrezrv
andrezrv / tar-examples.sh
Created December 24, 2013 19:03
Examples on how to compress and uncompress using Tar.
###################
# Compress a folder
###################
tar czfv test.tar.gz test/
# "czfv" stands for "Compress Zip File Verbose"
# If you want bzip files, use "j" instead of "z".
###################
# Uncompress a file
###################
// Clamps a block of text to a certain number of lines,
// followed by an ellipsis in Webkit and Blink based browsers
// Reference: http://dropshado.ws/post/1015351370/webkit-line-clamp
@mixin text-clamp($lines: 2, $line-height: false) {
overflow: hidden;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: $lines;
// Fallback for non-Webkit browsers