Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Adding a few of my older snippets, just for posterity's sake. And hav…

…ing them all in the same location. This includes a CSS-parsing Regex (not great, but it catches most of the standard selectors), and a snippet for creating tmp directories.
  • Loading branch information...
commit f5ddebe720ac04d4c34682a8a6523d5baaa80bb2 1 parent 1782167
Mike Tierney authored May 27, 2009

Showing 2 changed files with 8 additions and 0 deletions. Show diff stats Hide diff stats

  1. 2  regexen.rb
  2. 6  tmpdir.rb
2  regexen.rb
... ...
@@ -0,0 +1,2 @@
  1
+# Works for non-edge case CSS files... it's ugly, but it'll get the bulk of the selectors.  It'll also grab font names and a few more things that you probbaly don't want either.  Use a SAC parser instead.
  2
+/([\.|^\#|^|\s]([\.a-zA-Z0-9_-]+)\s?){1,}[\,|\{]/
6  tmpdir.rb
... ...
@@ -0,0 +1,6 @@
  1
+# Create a tmp directory for use in ... well, whenever you'd need a tmp directory.  Mostly useful for testing, but there are other uses too.
  2
+
  3
+>> require 'tmpdir'
  4
+#=> true
  5
+>> Dir::tmpdir
  6
+#=> "/var/folders/22/22A2X2I6HcmsssIW7SdM7++++TI/-Tmp-"

0 notes on commit f5ddebe

Please sign in to comment.
Something went wrong with that request. Please try again.