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 / 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
@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:
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 / phpinfo-alfred
Created June 14, 2014 16:42 — forked from cvn/phpinfo-cli
Output from phpinfo() in Alfred
PHP Version => 5.4.24
System => Darwin ground.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Build Date => Jan 19 2014 21:18:21
Configure Command => '/private/var/tmp/apache_mod_php/apache_mod_php-87.2~1/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--sysconfdir=/private/etc' '--with-apxs2=/usr/sbin/apxs' '--enable-cli' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/Library/Server/Web/Config/php' '--with-libxml-dir=/usr' '--with-openssl=/usr' '--with-kerberos=/usr' '--with-zlib=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--disable-cgi' '--with-curl=/usr' '--enable-dba' '--enable-ndbm=/usr' '--enable-exif' '--enable-fpm' '--enable-ftp' '--with-gd' '--with-freetype-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.2~1/Root/usr/local' '--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.2~1/Root/usr/local' '--with-png-dir=/Bin
@cvn
cvn / phpinfo-cli
Created June 14, 2014 15:52
Output from phpinfo() in command line php
PHP Version => 5.4.24
System => Darwin ground.local 13.2.0 Darwin Kernel Version 13.2.0: Thu Apr 17 23:03:13 PDT 2014; root:xnu-2422.100.13~1/RELEASE_X86_64 x86_64
Build Date => Jan 19 2014 21:18:21
Configure Command => '/private/var/tmp/apache_mod_php/apache_mod_php-87.2~1/php/configure' '--prefix=/usr' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--sysconfdir=/private/etc' '--with-apxs2=/usr/sbin/apxs' '--enable-cli' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/Library/Server/Web/Config/php' '--with-libxml-dir=/usr' '--with-openssl=/usr' '--with-kerberos=/usr' '--with-zlib=/usr' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--disable-cgi' '--with-curl=/usr' '--enable-dba' '--enable-ndbm=/usr' '--enable-exif' '--enable-fpm' '--enable-ftp' '--with-gd' '--with-freetype-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.2~1/Root/usr/local' '--with-jpeg-dir=/BinaryCache/apache_mod_php/apache_mod_php-87.2~1/Root/usr/local' '--with-png-dir=/Bin
function colorFromString(str, length) {
if (!str){
str = 'null';
}
if (length){
jobColorSource = hex_md5(str.substring(0,length));
}else{
jobColorSource = hex_md5(str.substring(0,4));
}
jobColor = new Array(jobColorSource.substr(0,2), jobColorSource.substr(2,2), jobColorSource.substr(4,2));
@cvn
cvn / .profile
Last active August 29, 2015 13:56
Git Prompt
# original git prompt from ray
# http://raysohn.com/posts/simple-git-prompt.html
# Fix wrapping behavior (escape non-printing characters)
# http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/nonprintingchars.html
# Output escaped non-printing characters from a function
# http://stackoverflow.com/a/13997892/490592
# Maintain new tab behavior in Terminal.app
# http://superuser.com/a/623305/75328
simple_git_prompt () {
@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