Skip to content

Instantly share code, notes, and snippets.

View stevenkword's full-sized avatar
🎯
Focusing

Steven Word stevenkword

🎯
Focusing
View GitHub Profile
@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
}
@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.
@bradtraversy
bradtraversy / node_cheerio_scraping.js
Created August 6, 2018 02:55
Simple example to scrape some posts and put into a CSV file using Node & Cheerio
const request = require('request');
const cheerio = require('cheerio');
const fs = require('fs');
const writeStream = fs.createWriteStream('post.csv');
// Write Headers
writeStream.write(`Title,Link,Date \n`);
request('http://codedemos.com/sampleblog', (error, response, html) => {
if (!error && response.statusCode == 200) {
@helgatheviking
helgatheviking / custom-modal-metabox.js
Last active November 2, 2022 14:49
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: {} } );
@ahmadawais
ahmadawais / .eslintignore
Last active September 15, 2020 04:02
WP: Gutenberg ESLint
**/*.min.js
**/node_modules/**
**/vendor/**
build
coverage
cypress
node_modules
vendor
@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: '';
@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
@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)}.
@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>.