Skip to content

Instantly share code, notes, and snippets.

View badcrocodile's full-sized avatar

Jason badcrocodile

  • The Motley Fool
  • Austin, Texas
View GitHub Profile
@bennuttall
bennuttall / bar_chart.py
Last active March 9, 2016 18:21
Code snippets from ASCII Bar Charts blog post
2000 ||
2001 |||||||||
2002 ||||||||||
2003 |||||||||
2004 ||||||||||||||
2005 |||||||||||
2006 ||||||||
2007 ||||||||||
2008 ||||||||||||||
2009 |||||||||||||||||||
@eugenoprea
eugenoprea / functions.php
Last active December 8, 2022 11:37
Gravity Forms - Checkbox Dynamic Population
// When true, the form will be saved to DB after dynamic population
define('EO_SAVE_FORM_ON_PRE_RENDER', true);
// Adds a filter to form id 7. Replace 26 with your actual form id
add_filter('gform_pre_render_7', 'eo_populate_checkbox');
add_filter('gform_admin_pre_render_7', 'eo_populate_checkbox');
function eo_populate_checkbox($form) {
if (EO_SAVE_FORM_ON_PRE_RENDER)
@m1r0
m1r0 / wp_insert_attachment_from_url.php
Last active August 1, 2024 04:14
WP: Insert attachment from URL
<?php
/**
* Insert an attachment from a URL address.
*
* @param string $url The URL address.
* @param int|null $parent_post_id The parent post ID (Optional).
* @return int|false The attachment ID on success. False on failure.
*/
function wp_insert_attachment_from_url( $url, $parent_post_id = null ) {
#!/usr/bin/env bash
#
# see: https://gist.github.com/gregorynicholas/2160046ec6946a2ce0fa
# src: https://github.com/mathiasbynens/dotfiles/blob/master/.osx
# updated: 2015-06-06
#
# ask for the administrator password upfront
sudo -v