Tag: regex

ASP.NET/C# image resizer for responsive layouts

I will probably elaborate on this a bit further when I find some more time, but for now, this post is going to be mostly code. What I have here is a relatively simple way to generate images that are resized server-side based on the screen dimensions (note: not window …

Continue reading

Lower-case specific query string keys with IIS URL Rewrite

We're going through some normalization of URLs at my day job, which has necessitated some interesting rewrite rules for lower-casing specific query string keys. Essentially, we need to turn site=CampusName into site=campusname. After quite a bit of tinkering with IIS URL Rewrite rules, I managed to pull it …

Continue reading

Validating file uploads in Sitecore WFFM

Our Sitecore installation was in dire need of a way to lock down file uploads on forms built with the Web Forms for Marketers (WFFM) module; out of the box, it doesn't do any checking at all, which can lead to some risky situations. I tacked on a simple whitelist …

Continue reading

Bulk rename Subversion files with PowerShell

Scenario: We're upgrading our reporting software at work, and the way that it used to integrate with SVN (through a terrible SCC bridge) involved arbitrarily placing "app_" at the head of the file names. Of course, in the new version, they no longer do this, and so all of our …

Continue reading

rexCrawler and HelpfulHighlighter are now open source

After having dipped my toe in the water of open source with some Arachni module changes and the development of a simple WordPress plugin, I've finally taken the plunge; two of my personal projects are now completely open source, and hosted on github. Much of the code is stale—and …

Continue reading

WordPress plugin minify Makefile

While working on my first commercial WordPress plugin, the need for build automation finally struck me. The environments in which I do my most development are all driven by Linux, and so I wanted to use a tried, true, and ubiquitous build automation mechanism to fulfill my need. As such …

Continue reading

Easy SSL redirection for select folders in nginx

I have many various web applications installed on my server; some of them need to be wrapped in a secure connection, while it is less important (or meaningless) for others. For those applications whose security I am concerned about, I've developed an easy way to force nginx to serve the …

Continue reading

Kill all shared memory segments in Linux

I recently whipped up a shell script to kill all (IPC) shared memory segments in Linux for a client on oDesk.com. He wound up going with another contractor's offer, and so I figured I would post my script here for the benefit of all.

1
ipcs -m | cut -d …
Continue reading

Create anchor links in Twitter status text with JavaScript

Note: This also applies to any service using a Twitter-compatible API, such as StatusNet (see: identi.ca) with some minor configuration changes.

As a side project, I have been working on a StatusNet (specifically, identi.ca) status feed widget for the WordPress PHP platform. I had spent a fair …

Continue reading

bulkRename v1.1

A while back (in 2008), I wrote a simple system utility with VB.NET which leverages the power of regular expressions to rename files in bulk according to a pattern. I've had to use it several times recently after placing it on a metaphorical shelf to gather dust, and it …

Continue reading