Skip to content

Instantly share code, notes, and snippets.

View borkabrak's full-sized avatar

Jonathan Carter borkabrak

  • Nashville, TN
View GitHub Profile
// Return true/false whether input string is a palindrome
function is_palindrome(input) {
// normalize input to ignore case and non-word chars
input = input.toUpperCase().replace(/\W/g,"");
// anything less than two chars is automatically a palindrome
return (input.length < 2) ?
true :
// if first and last chars differ, not a palindrome
@borkabrak
borkabrak / gist:7453043
Created November 13, 2013 17:33
Output text so that it looks like someone is typing it. (Filters STDIN to STDOUT with random short intervals between characters)
#!/usr/bin/env ruby
#
# Print output as if someone was typing it.
#
# * random short intervals between characters
#
# I have no idea why this seems so neat to me.
# Try piping the output of w3m -dump to it.
#
# -jdc 2013-06-20