Skip to content

Instantly share code, notes, and snippets.

@mxlje
Created August 2, 2014 15:49
Show Gist options
  • Select an option

  • Save mxlje/90c08f6c0ccf1161a947 to your computer and use it in GitHub Desktop.

Select an option

Save mxlje/90c08f6c0ccf1161a947 to your computer and use it in GitHub Desktop.
Random ID TextExpander snippets
#!/usr/bin/env ruby
print `uuidgen`.downcase.split("-").take(2).join
#!/usr/bin/env ruby
print `uuidgen`.downcase.strip
@mxlje
Copy link
Copy Markdown
Author

mxlje commented Aug 2, 2014

I have them mapped to ;id and ;uuid respectively.

@stalcottsmith
Copy link
Copy Markdown

I prefer base 36 which can also be case invariant.

Here is my goto solution: https://gist.github.com/stalcottsmith/1b74155cbfe3a23d8573

Which gives me numbers like:

tg9wa3kblz9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment