Skip to content

Instantly share code, notes, and snippets.

@cvn
cvn / fix-legacy-offload-media.php
Created November 26, 2022 08:20
Page to view and fix legacy WP Offload Media images
<form method="post">
<button type="submit">
Fix WP Offload Media images
</button>
<?= $_SERVER['REQUEST_METHOD'] === 'POST' ? '✓' : ''; ?>
</form>
<?php
include('wp-config.php');
@cvn
cvn / update_ip.py
Last active November 11, 2022 16:25
A script for updating dynamic DNS using Opalstack's API
#!/usr/bin/env python3
# update_ip.py - A script for updating dynamic DNS using Opalstack's API
# by Chad von Nau
#
# * Python 2 and 3 compatible.
# * Supports IPv4 and IPv6 addresses.
# * Records the last IP in a JSON file and only calls the API if the IP has changed.
#
# Instructions:
@cvn
cvn / download-my-webfaction.sh
Created December 10, 2020 07:34
A shell script to download a copy of your my.webfaction.com, requires wget
#!/bin/sh
if ! command -v wget &> /dev/null
then
echo "wget could not be found"
exit
fi
read -p 'Username: ' USERNAME
read -sp 'Password: ' PASSWORD
diff --git a/assets/build/app.css b/assets/build/app.css
index 6d3f4b6..ade29f5 100644
--- a/assets/build/app.css
+++ b/assets/build/app.css
@@ -144,6 +144,10 @@ a.link-with-image:focus > span {
background-color: #434343;
background-color: rgba(133, 133, 133, 0.5);
}
+.json-formatter-dark {
+ padding: 15px;
@cvn
cvn / functions.php
Last active December 18, 2015 05:39
Wordpress Subheading plugin tab order fix
/**
* Inject javascript to fix tab order for Subheading plugin input field
*/
function add_jquery_data() {
// only load on new post / edit post page
global $parent_file;
if ( is_admin() && $parent_file == 'edit.php'): ?>
<script type="text/javascript">
jQuery(document).on('ready', function(){
var titleInput = jQuery('input#title')
NameError at /new-account
global name 'forms' is not defined
Request Method: POST
Request URL: http://localhost:8000/new-account
Django Version: 1.4.1
Exception Type: NameError
Exception Value:
global name 'forms' is not defined
Exception Location: /Users/chad/Sites/post/Post/source/postghost/apps/webplayer/views.py in clean_email, line 223
Python Executable: /Users/chad/Sites/post/ENV/bin/python
43 requests ❘ 71.68KB transferred ❘ 8.09s (onload: 3.44s, DOMContentLoaded: 3.18s)
tiff.png
/static/img/icons/system/128
app.png
/static/img/icons/system/128
jar.png
/static/img/icons/system/128
:8000/api/industry/uploadgroup/
HeadersContent
@cvn
cvn / gist:2981807
Created June 24, 2012 05:38
Apache icons workaround for Webfaction (httpd.conf)
<IfModule mod_autoindex.c>
Alias /webfaction-apache-icons /var/www/icons
AddIconByEncoding (CMP,/webfaction-apache-icons/compressed.gif) x-compress x-gzip
AddIconByType (TXT,/webfaction-apache-icons/text.gif) text/*
AddIconByType (IMG,/webfaction-apache-icons/image2.gif) image/*
AddIconByType (SND,/webfaction-apache-icons/sound2.gif) audio/*
AddIconByType (VID,/webfaction-apache-icons/movie.gif) video/*
@cvn
cvn / linkify.js
Created September 7, 2011 01:37
linkify twitter feed
function linkify(tweet_text,entities){
// function borrowed from http://140dev.com/free-twitter-api-source-code-library/twitter-display/linkify-php/
// entities is an object delivered by the Twitter API for each tweet with
// the user @mentions, hastags, and URLs broken out along with their positions
// Constants
var user_mention_url = 'http://twitter.com/',
user_mention_title = '';
hashtag_url = 'http://twitter.com/search?q=',
hashtag_title = '';
@cvn
cvn / class.format.php
Created May 2, 2011 02:14
Vanilla forums (v2) youtube / vimeo mods
<? // Replace LinksCallback() in class.format.php with the below, starting at line 551
protected static function LinksCallback($Matches) {
$Pr = $Matches[1];
$Url = $Matches[2];
if (preg_match('/(www\.)?youtube.com\/watch\?v=([^&]+)/', $Url, $Matches) && C('Garden.Format.YouTube')) {
$ID = $Matches[2];
$Width = 640;
$Height = 390;
$Result = <<<EOT
<div class="Video"><iframe title="YouTube video player" width="$Width" height="$Height" src="http://www.youtube.com/embed/$ID" frameborder="0" allowfullscreen></iframe></div>