Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Steven Word stevenkword

🎯
Focusing
View GitHub Profile
@bradtraversy
bradtraversy / node_cheerio_scraping.js
Created Aug 6, 2018
Simple example to scrape some posts and put into a CSV file using Node & Cheerio
View node_cheerio_scraping.js
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) {
@ahmadawais
ahmadawais / .eslintignore
Last active Sep 15, 2020
WP: Gutenberg ESLint
View .eslintignore
**/*.min.js
**/node_modules/**
**/vendor/**
build
coverage
cypress
node_modules
vendor
@felixarntz
felixarntz / multisite-recap-boilerplate.txt
Created Jun 23, 2017
Multisite Recap Post Boilerplate
View multisite-recap-boilerplate.txt
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 Jun 27, 2017
Multisite Agenda Post Boilerplate
View multisite-agenda-boilerplate.txt
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>.
@helgatheviking
helgatheviking / custom-modal-metabox.js
Last active Aug 8, 2021
Create a completely custom media frame (WIP)
View custom-modal-metabox.js
/**
* @type {Object} JavaScript namespace for our application.
*/
var Custom_Modal = {};
(function($, Custom_Modal) {
var $ = jQuery;
_.extend( Custom_Modal, { view: {}, controller: {} } );
View admin.css
.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 Sep 12, 2018
Never go idle in hipchat - Disable hipchat idle when away from computer
View gist:70b00c97df43827279f7
#! /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
@prettyboymp
prettyboymp / lift-comment-facet.php
Created Nov 11, 2013
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.
View lift-comment-facet.php
<?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
@eduardozulian
eduardozulian / wp-customize-image-reloaded.php
Last active May 7, 2020
Extend WP_Customize_Image_Control class allowing access to files uploaded within the same context.
View wp-customize-image-reloaded.php
<?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.
@naholyr
naholyr / _service.md
Created Dec 13, 2012
Sample /etc/init.d script
View _service.md

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)