Skip to content

Instantly share code, notes, and snippets.

View COLABORATI's full-sized avatar

COLABORATI

View GitHub Profile
@JayWood
JayWood / wpcli-posts-generator.php
Created May 6, 2016 14:14
A robust random posts generator with support for multisite, taxonomies, term counts, post counts, post types, featured images, featured image types, and more.
<?php
if ( defined( 'WP_CLI' ) && WP_CLI ) {
class JW_Random_Posts extends WP_CLI_Command {
private $args, $assoc_args;
/**
* Generates a Random set of posts
*
@nathanhornby
nathanhornby / scroll2.js
Created December 16, 2015 00:21
Velocity.js jQuery smooth scroll to #id
/* Scroll2
=======================
Takes one argument, `speed`. Defaults to 500.
Examples:
$('.scroll2').scroll2(); // <a href="#contact" class="scroll2">Contact me</a>
$('#scrollToTop').scroll2(700); // <a href="#header" id="scrollToTop">Scroll to top</a>
@bjornjohansen
bjornjohansen / run-wp-cron.sh
Last active September 17, 2023 21:12
Run all due cron events for WordPress with WP-CLI. Works with both single sites and multisite networks.
#!/bin/bash
# Copyright © 2015 Bjørn Johansen
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
WP_PATH="/path/to/wp"
# Check if WP-CLI is available
if ! hash wp 2>/dev/null; then
@nathanhornby
nathanhornby / typeform-velocity.js
Created December 4, 2015 11:37
Scroll to active field in form (typeform style animation) using velocity.js
// Insert into some kind of 'focus' action
var parent = $(this).parent().parent('.fieldWrap'); // Target a wrapper
// Reset active state
$('.fieldWrap').removeClass('active');
// Add active state to current field
parent.addClass('active');
@nathanhornby
nathanhornby / magnific-velocity.js
Last active June 20, 2016 22:36
Magnific popup with velocity.js animation boilerplate
$.magnificPopup.open({
items: {
src: '#popup',
type: 'inline'
},
removalDelay: 400,
callbacks: {
open: function () {
this.content.velocity('transition.slideDownIn', {
duration: 400
@cecilemuller
cecilemuller / readme.md
Last active January 29, 2016 15:09
Let's encrypt (Nginx, Ubuntu 14.04 LTS)

Install the client:

apt-get install git
git clone https://github.com/letsencrypt/letsencrypt
cd letsencrypt

Generate certificates using manual mode:

@haimingpro
haimingpro / Magnific Popup + Animate.css.markdown
Created July 1, 2015 06:15
Magnific Popup + Animate.css