Recent Updates RSS Hide threads | Keyboard Shortcuts

  • Custom-User-CSS - Wordpress Plugin

    oremj 3:54 pm on February 11, 2009 | 4 Permalink | Reply
    Tags: ,

    I hacked up a new wordpress plugin that gives users more control over the appearance of their blogs.  This plugin is especially useful for WordpressMU maintainers and users.  Read more about it or visit its wordpress.org home.

     
    • sethb 9:18 am on February 12, 2009 Permalink | Reply

      Thanks, Jeremy. I hope to use this to practice some basic CSS experiments with my blog. It’ll be very helpful and I really appreciate your work.

    • Frederick 3:12 pm on February 15, 2009 Permalink | Reply

      Hello and thanks.

      I have a few recommendations for this plugin, especially when used on WordPress µ.

      First of all, add the menu page under the Appearance menu. This can be accomplished with
      add_theme_page('Custom CSS Options', 'Custom CSS', 'switch_themes', __FILE__, 'custom_user_css_options');
      as opposed to the current call under the custom_user_css_menu() function.

      Secondly, when installing for WordPress µ, it is wise to place the plugin folder under /wp-content/plugins/ BUT also to move the main plugin file to /wp-content/mu-plugins/. This will enable the Custom CSS feature for all blogs and users. It is necessary to rewrite the include() function so that the menu page, which exists in /wp-content/plugins/custom-user-css/, can be included or required by the plugin file.

      Hope this helps the plugin.

      Regards,
      Frederick

    • Philip M. Hofer (Frumph) 5:51 pm on March 26, 2009 Permalink | Reply

      custom_user_css.php line(52)

      $css_val = $wpdb->escape(strip_tags($_POST[ $opt_name ]));

      ….
      Yeah I know, redundant, but still helpful. Makes it extra secure.

    • Philip M. Hofer (Frumph) 5:59 pm on March 26, 2009 Permalink | Reply

      function custom_user_css_menu() {
      add_submenu_page(’themes.php’, ‘Custom User CSS’, ‘Custom User CSS’, 8, ‘Custom User CSS’, ‘custom_user_css_options’);
      }

      This puts the Custom CSS inside the Appearance Menu for users.

  • Simple bash locking

    oremj 7:33 pm on December 2, 2008 | 0 Permalink | Reply
    Tags: , IT, Scripting

    I often need to create lock files in my scripts, so crontab doesn’t spawn more than one process.  This is a simple bash lock file function I like to use:

    function create_lock {
            LOCK_NAME=$1
            if [[ -e "$LOCK_NAME" ]]
            then
                    OLDPID=`cat $LOCK_NAME`
                    if ps p $OLDPID > /dev/null
                    then
                            return 1
                    fi
                    rm $LOCK_NAME
            fi
            echo $$ > $LOCK_NAME
            return 0
    }

    create_lock doesn’t handle race conditions, but it is typically good enough for me.

     
  • Mediawiki Google Search Appliance Integration

    oremj 3:07 pm on October 15, 2008 | 1 Permalink | Reply
    Tags: ,

    I was given the task of integrating our old Google Search Appliance with our internal wiki.    It turns out MediaWiki offers a couple of different ways to alter search functionality: $wgSearchForwardUrl and $wgSearchType.  The $wgSearchType variable accepts a SearchEngine class name and enables custom search back-ends.  SimpleXML and the GSA XML API then allowed me to fetch and process the search results.  After a few hours of tweaking I am pretty happy with the result, a tightly integrated full text search.

    If you are interested in setting up your Google Search Appliance with a mediawiki instance, installation is simple, download or checkout the extension and follow the installation instructions.

     
  • My Life is a Little Bit Easier Now

    oremj 2:42 pm on September 12, 2008 | 3 Permalink | Reply
    Tags: , Mozilla

    Lately, I’ve found the process of assigning a bug to myself slightly cumbersome and wanted to speed up the process.  I happen to be a fan of Ubiquity, so I decided to write a command.

    The command assigntome, by default, changes the assigned to field to your user.  The whole process can be automated by tacking on the submit noun, which will simulate clicking the “Commit” button.

    To install assigntome subscribe to my Ubiquity feed.

     
    • DRORASSEMYDAY 9:34 am on October 1, 2008 Permalink | Reply

      Hi
      Nice site!

      G’night

    • ClarkT 8:26 am on December 18, 2008 Permalink | Reply

      Wow, what a coincidence I hate ubiquity feeds as well. I am so glad you developed this amazing tool. Where can I find more of your work.

  • MediaWiki: HttpAuth Plugin

    oremj 7:21 pm on September 7, 2008 | 1 Permalink | Reply
    Tags: ,

    All HttpAuth Plugin development has moved here from my work blog.  Mozilla’s internal wikis have been using the extension without issue.  Is anyone aware of issues that need fixing?

     
    • joe 7:38 am on December 4, 2008 Permalink | Reply

      If you could put the snippet from your diff that goes in to LocalSettings.php into the mediawiki article on your plugin, that’d be swell. The directions for which hook to change didn’t parse too well in my head, I’m afraid.

  • SimpleCaptcha Update

    oremj 4:52 pm on September 4, 2008 | 1 Permalink | Reply
    Tags: ,

    I’ve decided to move SimpleCaptcha development to my personal server.

     
c
compose new post
j
next post/next comment
k
previous post/previous comment
r
reply
e
edit
o
show/hide comments
t
go to top
esc
cancel