Skip to content

Instantly share code, notes, and snippets.

Nick Haskins bearded-avenger

Block or report user

Report or block bearded-avenger

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View notify.rb
module Checkups::Notify
require 'slack-notify'
class Dispatch
def initialize(params)
@message = params[:message]
@room = params[:room] || '#web-dev_events'
@botname = params[:botname] || 'EDU Bot'
@bearded-avenger
bearded-avenger / devise.rb
Last active Feb 24, 2019
Rails - SSO - WordPress - Authenticating against a WordPress install from a Rails site using oAuth
View devise.rb
config.omniauth :wordpress_hosted, ENV['SSO_KEY'], ENV['SSO_SECRET'],
strategy_class: OmniAuth::Strategies::WordpressHosted,
client_options: { site: ENV['SSO_URL'] }
View lasso-sample-meta-plugin.php
<?php
/**
* Plugin Name: Lasso Sample Settings Addon
*
*/
add_filter('lasso_modal_tabs','try_tabs');
function try_tabs( $tabs ){
$tabs[] = array(
@bearded-avenger
bearded-avenger / social.php
Last active Aug 29, 2015
dead-simple-social-shit-4000-super-duper-beards-with-goats.php
View social.php
<?php
/**
*
* This class holds all teh functionality for social sharing and social data so you dont need a plugin
* Ex: https://lasso.is/now-entering-the-arena/ (bottom)
*
* use social sharing like so:
* <a href="#" class="post-share__twitter">share twitter</a>
* <a href="#" class="post-share__fb">share fb</a>
View dropcap.less
.lead {
font-size: 1.3em;
font-weight: 200;
line-height: 1.6;
&.dropcap:first-letter {
float: left;
font-size: 3.4rem;
line-height: 2rem;
padding-top: 1.2rem;
@bearded-avenger
bearded-avenger / mixin.less
Created Feb 22, 2015
Grid Layout - CSS - nth child
View mixin.less
// this targets 1,5,7,11,13,17,19...
.ale--66 {
&:nth-child(6n+1),
&:nth-child(6n+5){
width:66.666%;
}
}
// this targets - 2,4,8,10,14,16,20....
.ale--33 {
View gist:998880369691b54bf220
add_shortcode('ideas','ideas_shortcode');
function ideas_shortcode(){
ob_start();
$args = array(
'post_type' => 'ideas',
'posts_per_page' => -1
);
$q = new WP_Query($args);
@bearded-avenger
bearded-avenger / author-network-posts.php
Created Nov 7, 2014
Return a list of posts by a specific author no matter the site on the multisite network
View author-network-posts.php
/**
*
* Return a list of posts by a specific author no matter the site on the multisite network
*
* @param $userid int id of a user
* @param $limit int number of results to return
*
*
*/
function get_user_posts_on_network( $userid = 0, $limit = 9 ) {
@bearded-avenger
bearded-avenger / blur.less
Created Oct 27, 2014
CSS Blur - No IE Support
View blur.less
.abs-pos-img-div {
position: absolute;
top:0;
left:0;
width:100%;
height:100%;
background-size:cover;
background-position:center center;
z-index: 0;
.translate3d(0, 0, 0);
View field-type.php
/**
* Gets a number of posts and displays them as options
* @param array $query_args Optional. Overrides defaults.
* @return array An array of options that matches the CMB options array
*/
function cgc_get_posts_for_cmb( $query_args ) {
$args = wp_parse_args( $query_args, array(
'post_type' => array('post'),
'numberposts' => -1,
You can’t perform that action at this time.