Skip to content

Instantly share code, notes, and snippets.

View dancr13's full-sized avatar
๐Ÿ˜Ž

Daniel dancr13

๐Ÿ˜Ž
View GitHub Profile
@mathetos
mathetos / functions.php
Last active March 12, 2019 14:10
Function for conditionally enqueing minified or un-minified scripts based on WP_DEBUG
<?php
add_action( 'wp_enqueue_scripts', 'debug_theme_enqueue_styles' );
function debug_theme_enqueue_styles() {
if (WP_DEBUG == true) :
$random = mt_rand();
wp_enqueue_style( 'main-css-unminified', get_template_directory_uri() . '/assets/styles/build/main.css', '', $random );
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE
@mirkonasato
mirkonasato / signalign
Last active April 23, 2020 12:14
Sign and align an Android APK
#!/bin/sh
#
# Automates signing and aligning Android APKs as per
# http://developer.android.com/tools/publishing/app-signing.html#signing-manually
#
# USAGE: signalign platforms/android/build/outputs/apk/android-release-unsigned.apk
#
set -e
# configure the next two properties for your own certificate
@kosinix
kosinix / custom-nav-walker-usage.php
Last active January 4, 2025 08:57
WordPress: Using a custom nav walker to create navigation menus in plain <a> tags. That is the <ul> and <li> tags are not present. Very useful if you want to create simple links that can be centered with a simple text-align:center on the containing element.
<?php
// In your template files like footer.php
// The items_wrap value ('%3$s') removes the wrapping <ul>, while the custom walker (Nav_Footer_Walker) removes the <li>'s.
wp_nav_menu(array('items_wrap'=> '%3$s', 'walker' => new Nav_Footer_Walker(), 'container'=>false, 'menu_class' => '', 'theme_location'=>'footer', 'fallback_cb'=>false ));
?>