Skip to content

Instantly share code, notes, and snippets.

View stevenkword's full-sized avatar
🎯
Focusing

Steven Word stevenkword

🎯
Focusing
View GitHub Profile
@naholyr
naholyr / _service.md
Created December 13, 2012 09:39
Sample /etc/init.d script

Sample service script for debianoids

Look at LSB init scripts for more information.

Usage

Copy to /etc/init.d:

# replace "$YOUR_SERVICE_NAME" with your service's name (whenever it's not enough obvious)
@eduardozulian
eduardozulian / wp-customize-image-reloaded.php
Last active November 16, 2023 02:50
Extend WP_Customize_Image_Control class allowing access to files uploaded within the same context.
<?php
/**
* Customize Image Reloaded Class
*
* Extend WP_Customize_Image_Control allowing access to uploads made within
* the same context
*/
class My_Customize_Image_Reloaded_Control extends WP_Customize_Image_Control {
/**
* Constructor.
@prettyboymp
prettyboymp / lift-comment-facet.php
Created November 11, 2013 14:02
Example plugin for Lift Search. The below example will add a comment count field to the search handing. Another example for adding a taxonomy can be see within the plugin, https://github.com/voceconnect/lift-search/blob/master/wp/field.php#L711.
<?php
define( 'lift_comment_facet_version', 1 );
add_action( 'init', function() {
if ( class_exists( 'Lift_Search' ) ) {
//field name, field type
$comment_field = liftField( 'comment_count', 'uint' )
//add field to parse_request handling so it gets passed to the global WP_Query
->addRequestVars( 'comment_count' )
//set the delegate for adding the field value to the document sent to CS
@lfender6445
lfender6445 / gist:70b00c97df43827279f7
Last active September 12, 2018 07:50
Never go idle in hipchat - Disable hipchat idle when away from computer
#! /bin/bash
# This if for the mac hipchat client
# To setup, download this file to any folder and save as `hip.sh`
# change the permissions of the file so it is executable using terminal
# You can do this by running `chmod u+x ./hip.sh`
# Now you can run `./hip.sh`
echo 'Hipchat hooray...ho... - Press CTRL+C to stop'
while :
do
@igorbenic
igorbenic / admin.css
Last active April 2, 2020 03:49
How to Create a Sortable WordPress Gallery | http://www.ibenic.com/create-sortable-wordpress-gallery/
.sortable_wordpress_gallery li.attachment {
width: 141px;
height: 141px;
}
.sortable_wordpress_gallery {
display: block;
}
.sortable_wordpress_gallery:after {
display: table;
content: '';
@helgatheviking
helgatheviking / custom-modal-metabox.js
Last active May 21, 2024 10:43
Create a completely custom media frame (WIP)
/**
* @type {Object} JavaScript namespace for our application.
*/
var Custom_Modal = {};
(function($, Custom_Modal) {
var $ = jQuery;
_.extend( Custom_Modal, { view: {}, controller: {} } );
@felixarntz
felixarntz / multisite-agenda-boilerplate.txt
Last active June 27, 2017 16:12
Multisite Agenda Post Boilerplate
Post Title:
Multisite Agenda for the week of {F jS (month + day)}
-----------------------------
Post Content:
<h2>Office Hours Agenda</h2>
This is the agenda for the weekly office hours meeting on [time relative]Tuesday 16:00 UTC[/time] in <a href="https://wordpress.slack.com/archives/core-multisite">#core-multisite</a>.
@felixarntz
felixarntz / multisite-recap-boilerplate.txt
Created June 23, 2017 13:32
Multisite Recap Post Boilerplate
Post Title:
Multisite Recap for the week of {F jS (month + day)}
-----------------------------
Post Content:
<h2>Office Hours Recap</h2>
The <a href="https://make.wordpress.org/core/{Y}/{m}/{d}/multisite-agenda-for-the-week-of-{F}-{jS}/">agenda for this office hours meeting</a> included/was {(brief one-sentence description of original meeting agenda)}.
@ahmadawais
ahmadawais / .eslintignore
Last active September 15, 2020 04:02
WP: Gutenberg ESLint
**/*.min.js
**/node_modules/**
**/vendor/**
build
coverage
cypress
node_modules
vendor
@dunglas
dunglas / example.php
Created April 19, 2018 06:25
A minimalist GraphQL client for PHP
<?php
$query = <<<'GRAPHQL'
query GetUser($user: String!) {
user (login: $user) {
name
email
repositoriesContributedTo {
totalCount
}