Skip to content

Instantly share code, notes, and snippets.

View coagmano's full-sized avatar
🐛
Bug curator @ Arthropods, Insecta, & Hemiptera

Frederick Stark coagmano

🐛
Bug curator @ Arthropods, Insecta, & Hemiptera
View GitHub Profile
{% if body contains "[BUTTON]" %}
{% assign body_parts = body | split:'[BUTTON]' %}
{% for part in body_parts %}
{% if part contains "[/BUTTON]" %}
{% assign button_part = part | split: "[/BUTTON]" | first %}
{% assign body_part = part | split: "[/BUTTON]" | last %}
{% assign button_parts = button_part | strip_html | split:'|' %}
{% capture button_text %}{% if button_parts[0].size > 0 %}{{ button_parts[0] }}{% else %}Contribute{% endif %}{% endcapture %}
{% capture button_link %}{% if button_parts[1].size > 0 %}{{ button_parts[1] }}{% else %}http://example.com{% endif %}{% endcapture %}
{% capture button_color %}{% if button_parts[2].size > 0 %}{{ button_parts[2] }}{% else %}#556270{% endif %}{% endcapture %}
.header-background {
position: relative;
background-color: $gray-dark;
background-image: url('women-320.jpg');
background-repeat: no-repeat;
background-position: center center ;
background-size: cover;
@media (min-width: $screen-sm-min) {
background-color: transparent;
/**
* Quick-donate function
* Takes the number after '#' in the URL and clicks the donate button with the same $amount
*/
jQuery(document).ready(function () {
var searchResult = /#\$?(\d+(?:\.\d{1,2})?)+/.exec(location.hash)
if ( searchResult !== null ) {
var amount = parseFloat(searchResult[1])
amount = Math.round(amount*100)/100
if (amount !== NaN) {
@coagmano
coagmano / User-Specific-Content.php
Last active August 14, 2016 19:09
Changes to User-Specific-Content WP plugin to remove unauthorised posts from The Loop
<?php
/*
These changes are for the plugin User-Specific-Content by Bainternet: https://wordpress.org/support/plugin/user-specific-content
Add the below funciton inside the class bainternet_U_S_C
*/
/* Change Init */
public function U_S_C_init(){
$options = $this->U_S_C_get_option();
if ($options['run_on_the_content']){

Keybase proof

I hereby claim:

  • I am coagmano on github.
  • I am coagmano (https://keybase.io/coagmano) on keybase.
  • I have a public key whose fingerprint is DAB3 030D 5C21 E5F3 4E17 C98E BA2B 6328 43B9 1213

To claim this, I am signing this object: