Skip to content

Instantly share code, notes, and snippets.

View postpostmodern's full-sized avatar

Jason T Johnson postpostmodern

View GitHub Profile
#!/usr/bin/env ruby
require 'rubygems'
require 'activeresource'
# Get your API key from your SliceManager here:
# https://manage.slicehost.com/api/
# and put it here:
API_PASSWORD = 'your_api_key_goes_here'
unless ARGV.size == 2 && ARGV[1].end_with?('.')
Test Gist
@postpostmodern
postpostmodern / unform.js
Created December 12, 2008 23:37
unform is a function for replacing form controls with plain text using jQuery
// Replaces form controls with plain text
function unform(form_class)
{
$('form.'+form_class+' input[type=text]').each(
function() {
$(this).after('<span class="proxy">' + $(this).attr('value') + '</span>');
$(this).hide();
}
).next().click(
function() {
@postpostmodern
postpostmodern / fixns.rb
Created February 5, 2009 17:02
Fixes NS records that incorrectly list slicehost.com instead of slicehost.net as the nameserver
#!/usr/bin/env ruby
# This should fix your NS records if you used the old version of slicedns.rb.
# Check to see if any of your zones list ns1/2/3.slicehost.com as a nameserver.
# It will change ALL NS records that have ns*.slicehost.com to ns*.slicehost.net
require 'rubygems'
require 'activeresource'
API_PASSWORD = 'your_api_key'
#!/usr/local/bin/ruby
require 'fileutils'
unless ARGV.size > 1
puts "Usage: #{__FILE__} alias@domain.com email [ email ] ..."
exit
end
QMAIL_DIR = "/var/qmail/mailnames"
alias_address = ARGV.shift
domain = alias_address.match(/[^@]+$/).to_s
<body class="<%= controller_name -%> <%= action_name -%>">
%body{:class => "#{controller_name} #{action_name}"}
#!/bin/bash
cd "/Users/_YOU_/Library/Application Support/Notational Data/"
# Make sure you've already set up the git repo
git add .
git commit -a -m "Simplenote Sync"
# Get SimplenoteSync here: http://fletcherpenney.net/other_projects/simplenotesync/
@postpostmodern
postpostmodern / 404.html
Last active February 20, 2022 01:34
My custom configurations for apache 2.2
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Page Not Found</title>
<style type="text/css" media="screen">
body {
background: #f0f0f0;
font: normal 18px sans-serif;
width: 400px;
// IE doesn't deal well with button elements.
// The following jQuery code fixes the two most common issues:
// 1. All button values being submitted whether they were clicked or not
// 2. Button labels being submitted instead of the value of the value attribute
// Make sure you have loaded jQuery, of course.
if ($.browser.msie) {
jQuery(function() {
$('form button[type=submit]').click(function() {
// Handle on the button clicked