Skip to content

Instantly share code, notes, and snippets.

@MikeWills
MikeWills / mike-wills-shortcodes.php
Created April 11, 2011 18:49
A sample plugin for WordPress short codes that can be used in your personal installation of WordPress.
<?php
/*
Plugin Name: Mike Wills' Shortcodes
Plugin URI: http://mikewills.me/projects
Description: A bunch of shortcodes for the network of Mike Wills' WordPress sites.
Version: 0.1
Author: Mike Wills
Author URI: http://mikewills.me
License: GPL2
*/
@MikeWills
MikeWills / SNDTWTMSG.clle
Created April 11, 2011 18:56
Send a Tweet using an old method. This code may not work anymore. Documented on [the midrange.com wiki](http://wiki.midrange.com/index.php/SNDTWTMSG)
PGM PARM(&USER &PASS &TWEET)
DCL VAR(&USER) TYPE(*CHAR) LEN(30)
DCL VAR(&PASS) TYPE(*CHAR) LEN(30)
DCL VAR(&TWEET) TYPE(*CHAR) LEN(140)
DCL VAR(&CMD) TYPE(*CHAR) LEN(300)
CHGVAR VAR(&CMD) VALUE('/installedApps/curl/curl --basic +
--user ' || &USER *TCAT ':' || &PASS *TCAT ' +
@MikeWills
MikeWills / Calendar.cs
Created April 11, 2011 19:06
I couldn't find an easy way to generate ical or JSON feeds in ASP.NET. This is what I created to get that done.
/*
Class: Calendar
Created by: Mike Wills (http://mikewills.me)
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Text;
@MikeWills
MikeWills / states.json
Created April 11, 2011 19:47
Full list of US states. 2.35kb
{"states":{"state":[{"name":"Alabama","shortCode":"AL"},{"name":"Alaska","shortCode":"AK"},{"name":"American Samoa","shortCode":"AS"},{"name":"Arizona","shortCode":"AZ"},{"name":"Arkansas","shortCode":"AR"},{"name":"Armed Forces Europe","shortCode":"AE"},{"name":"Armed Forces Pacific","shortCode":"AP"},{"name":"Armed Forces the Americas","shortCode":"AA"},{"name":"California","shortCode":"CA"},{"name":"Colorado","shortCode":"CO"},{"name":"Connecticut","shortCode":"CT"},{"name":"Delaware","shortCode":"DE"},{"name":"District of Columbia","shortCode":"DC"},{"name":"Federated States of Micronesia","shortCode":"FM"},{"name":"Florida","shortCode":"FL"},{"name":"Georgia","shortCode":"GA"},{"name":"Guam","shortCode":"GU"},{"name":"Hawaii","shortCode":"HI"},{"name":"Idaho","shortCode":"ID"},{"name":"Illinois","shortCode":"IL"},{"name":"Indiana","shortCode":"IN"},{"name":"Iowa","shortCode":"IA"},{"name":"Kansas","shortCode":"KS"},{"name":"Kentucky","shortCode":"KY"},{"name":"Louisiana","shortCode":"LA"},{"name":"Maine"
@MikeWills
MikeWills / BVSTSETUP.clle
Created April 11, 2011 19:58
Setup the environment for BVS Tools (SPLTOOL, AFPTOOL, MAILTOOL)
PGM
ADDLIBLE LIB(SPLTOOL) POSITION(*LAST)
MONMSG MSGID(CPF2103)
ADDLIBLE LIB(AFPTOOL) POSITION(*LAST)
MONMSG MSGID(CPF2103)
ADDLIBLE LIB(MAILTOOL) POSITION(*LAST)
MONMSG MSGID(CPF2103)
@MikeWills
MikeWills / STRING.bnd
Created April 11, 2011 21:17
Work with strings in RPG
/* ********************************************************************** */
/* Program . . . . . STRING */
/* */
/* Created on . . . 06/27/2006 */
/* by . . . Mike Wills (http://mikewills.me) */
/* */
/* Description . . . */
/* */
/* CHANGE LOG: */
/* Date | Name | Description */
@MikeWills
MikeWills / DATE.bnd
Created April 11, 2011 21:20
Work with dates in RPG
/* ********************************************************************** */
/* Program . . . . . DATE */
/* */
/* Created on . . . 06/08/2006 */
/* by . . . Mike Wills (http://mikewills.me) */
/* */
/* Description . . . */
/* */
/* CHANGE LOG: */
/* Date | Name | Description */
@MikeWills
MikeWills / ADVERROR.bnd
Created April 11, 2011 21:23
A common and consistent error message/message prompting module. Also uses https://gist.github.com/914365
/* ********************************************************************** */
/* Program . . . . . ADVERROR */
/* */
/* Created on . . . 08/10/2004 */
/* by . . . Mike Wills (http://mikewills.me) */
/* */
/* Description . . . */
/* */
/* CHANGE LOG: */
/* Date | Name | Description */
@MikeWills
MikeWills / ALERT.clle
Created April 12, 2011 19:14
Monitor for MSGW jobs on an IBM i. This example uses MAILTOOL, but also has for the built-in SNDDST.
/* ********************************************************************** */
/* Program . . . . . ALERT */
/* */
/* Created on . . . 04/09/2010 */
/* by . . . Mike Wills (http://mikewills.me) */
/* */
/* Description . . . */
/* */
/* CHANGE LOG: */
/* Date | Name | Description */
@MikeWills
MikeWills / status_h.rpgle
Created June 27, 2011 19:54
Constants for error codes used in MONITOR statements.
// Error Status Fields (Numeric Order)
D PGM_SUCCESS C CONST(00000)
D FILE_EOF C CONST(00011)
D FILE_NO_RECORD_FOUND...
D C CONST(00012)
D FILE_SFL_FULL C CONST(00013)
D PGM_DIVIDE_BY_ZERO...
D C CONST(00102)
D PGM_ALPHA_NUMERIC_ERROR...
D C CONST(00105)