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

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:

@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']){
/**
* 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) {
.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;
{% 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 %}
@coagmano
coagmano / nb-enlarge-preview.js
Created July 2, 2016 03:08
Enlarge the email preview windows on Nationbuilder
// ==UserScript==
// @name Enlarge NB preview
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Expands the email preview windows in Nationbuilder
// @author Fred Stark
// @match https://*.nationbuilder.com/admin/broadcasters/*/mailings/*/preview
// @grant none
// ==/UserScript==
/* jshint -W097 */
{% comment %}
/**
* This email template addon lets you calculate the donation ask amount based on
* previous history.
* Can be used unclosed to use default parameters:
* [ASK]
* Or supplied with parameters with a closing tag:
* [ASK]max|10|200|1.2[/ASK]
* - Parameters must be separated by a pipe '|'.
* - All parameters are optional and will revert to default if ommitted.
@coagmano
coagmano / gist:ea8176179cb7c831b9d762393b18cf77
Created January 8, 2017 23:26
Search NB pages bookmarklet
javascript:(function() {var query = window.prompt('Search term');if(query) {window.open('https://REPLACE_WITH_YOUR_SLUG.nationbuilder.com/admin/sites/1/pages/search?q='+query,'_blank');}})();
@coagmano
coagmano / gist:110d793c7bda2f2cae49e6b3bb395f55
Created January 8, 2017 23:46
BlockStack ID verification
Verifying that "coagmano.id" is my Blockstack ID. https://onename.com/coagmano
@coagmano
coagmano / example.conf
Last active June 22, 2017 23:58
Example Nginx ssl terminator with proxy-pass to node app
server {
listen 443;
ssl on;
server_name EXAMPLE.com www.EXAMPLE.com;
access_log /var/log/nginx/EXAMPLE.com.access.log rt_cache;
error_log /var/log/nginx/EXAMPLE.com.error.log;
# SSL cert via letsencrypt