Skip to content

Instantly share code, notes, and snippets.

View jrfnl's full-sized avatar
🐘
Herding 🐘

Juliette jrfnl

🐘
Herding 🐘
View GitHub Profile
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@wojtha
wojtha / gist:1034262
Created June 19, 2011 13:16
PHP Syntax Check for Git pre-commit hook for Windows PowerShell
###############################################################################
#
# PHP Syntax Check for Git pre-commit hook for Windows PowerShell
#
# Author: Vojtech Kusy <wojtha@gmail.com>
#
###############################################################################
### INSTRUCTIONS ###
@luetkemj
luetkemj / wp-query-ref.php
Last active April 25, 2024 09:37
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@sergeylukin
sergeylukin / pre-receive
Last active October 7, 2015 13:58
Git hook (pre-receive): commit any local changes before PUSH accepted
#!/bin/sh
#
# This hooks is placed in a Bare repository
# It makes sure that working tree doesn't contain any local changes
# And if it contains - submits a commit and returns false
# So if false returned - client should PULL and then PUSH again
#
# Assuming following file structure:
# .
# |-- myproject
@cameronmalek
cameronmalek / pre-receive.sh
Last active February 4, 2019 18:37
The `hooks/pre-receive` file I use for cameronmalek.com and other sites. It makes sure the working directory is clean before pushing updates, forcing the developer to commit and pull server-side updates first. It doesn't detect any staged, uncommitted files. A situation where someone stages but fails to commit a file isn't anticipated.
#!/bin/sh
export GIT_WORK_TREE=/home/cameronm/public_html/
export GIT_DIR=/home/cameronm/git/cameronmalek.git
ec=0
# test for unstaged, uncommitted files
git diff --exit-code &>-
if [ "$?" -ne 0 ]; then
echo "Changes not staged"
@krogsgard
krogsgard / meta-box-control.php
Created February 4, 2013 16:19
gist to lower priority of WP SEO metabox
<?php
add_filter('wpseo_metabox_prio','krogs_lower_wpseo_metabox', 10 );
function krogs_lower_wpseo_metabox( $priority ) {
$priority = 'low';
return $priority;
@wpscholar
wpscholar / functions.php
Last active March 1, 2021 13:26
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@manchuck
manchuck / pre-commit
Last active September 19, 2017 16:34
This is a ZF2 precommit hook that runs Lint, Mess Detector, Code sniffer then classmap builder on commit
#!/bin/sh
echo
exec powershell.exe -ExecutionPolicy RemoteSigned -File '.\.git\hooks\pre-commit-hook.ps1'
exit
@justintadlock
justintadlock / register-post-type.php
Last active October 22, 2023 05:55
Help file when registering post types.
<?php
# Register custom post types on the 'init' hook.
add_action( 'init', 'my_register_post_types' );
/**
* Registers post types needed by the plugin.
*
* @since 1.0.0
* @access public
@ryansechrest
ryansechrest / post-receive.sh
Last active February 12, 2017 12:41
Git post-receive hook to deploy WordPress and plugins as submodules. It can also install Node.js modules with npm and vendor packages with Composer.
#!/bin/bash
# Created on 7/17/13 by Ryan Sechrest
# Deploys pushed branch from the origin repository to the web directory
if [[ (-n $1) && (-n $2) && (-n $3) ]]; then
# Set path to project directory
project_path="/var/www/domains/$2/$3"