Skip to content

Instantly share code, notes, and snippets.

@rickycodes
Created November 2, 2012 20:19
Show Gist options
  • Save rickycodes/4004078 to your computer and use it in GitHub Desktop.
Save rickycodes/4004078 to your computer and use it in GitHub Desktop.
flipString kickFlip
function flipString( str ) {
return str.toLowerCase().split( '' ).map( function( c ) {
return chars[ c ] ? chars[ c ] : c
}).reverse().join('')
}
function kickFlip( str ) {
return '(╯°□°)╯︵' + flipString( str )
}
var chars = {
'a' : '\u0250',
'b' : 'q',
'c' : '\u0254',
'd' : 'p',
'e' : '\u01DD',
'f' : '\u025F',
'g' : 'b',
'h' : '\u0265',
'i' : '\u0131',
'j' : '\u027E',
'k' : '\u029E',
'l' : '\u05DF',
'm' : '\u026F',
'n' : 'u',
'o' : 'o',
'p' : 'd',
'q' : 'b',
'r' : '\u0279',
's' : 's',
't' : '\u0287',
'u' : 'n',
'v' : '\u028C',
'w' : '\u028D',
'x' : 'x',
'y' : '\u028E',
'z' : 'z',
'[' : ']',
']' : '[',
'(' : ')',
')' : '(',
'{' : '}',
'}' : '{',
'?' : '\u00BF',
'\u00BF' : '?',
'!' : '\u00A1',
"\'" : ',',
',' : "\'",
'.' : '\u02D9',
'_' : '\u203E',
';' : '\u061B',
'9' : '6',
'6' : '9',
'\u2234' : '\u2235'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment