Highly decoupled functionality
- API Server
- Auth Server
- Web App
All separate codebases
- User hits web app, redirects to auth server
- User logs in
| Fixing _why's Evil Idea Encoder | |
| ============================== | |
| Working my way through _why's (poignant) guide to ruby, I noticed that | |
| the more complex his examples became, the less often they actually | |
| worked when tested. Frustrated by my inability to copy and paste examples | |
| into the shell and see them work without doing any real learning, I | |
| grudgingly decided to find a way to bring his examples to life and satisfy | |
| my obsessive need for results and tidiness. | 
| <!DOCTYPE HTML> | |
| <html lang='en-US'> | |
| <head> | |
| <meta charset='UTF-8'> | |
| <title></title> | |
| </head> | |
| <body> | |
| <a data-ga='play' data-context='game'>Play</a> | |
| <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script> | 
| // Stuck in an iframe? Link throwing an error in Chrome? | |
| // This jQuery snippet will make sure that every link and submit | |
| // without a specified target will open at the window.top.location level. | |
| jQuery(function($){ | |
| $(document).on('click', 'a, :submit', function() { | |
| var t = $(this)[0].target; if (t === '') t = '_top'; | |
| }); | |
| }); | 
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| <style type="text/css"> | |
| #map_canvas { | |
| height: 300px; | |
| width: 300px; | |
| } | 
| # git branch bedazzler (.each_line added before .grep for 1.9.x) | |
| # http://asemanfar.com/Current-Git-Branch-in-Bash-Prompt | |
| export PS1="\[\033[32m\]ツ\[\033[0m\] \[\033[37m\]\u@\h\[\033[01;34m\] \w \[\033[31m\]\`ruby -e \"print (%x{git branch 2> /dev/null}.each_line.grep(/^\*/).first || '').gsub(/^\* (.+)$/, '(\1) ')\"\`\[\033[37m\]$\[\033[00m\] " | 
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| <style type="text/css"> | |
| ul.backups { display: none; } | |
| </style> | |
| </head> | |
| <body> | 
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| </head> | |
| <body> | |
| <style type="text/css"> | |
| /* nicholas gallagher's tiny clearfix */ | 
| <!DOCTYPE HTML> | |
| <html lang="en-US"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title></title> | |
| </head> | |
| <body> | |
| <script type="text/javascript"> | |
| var params = { | |
| postcard: { | 
Highly decoupled functionality
All separate codebases
| for (var i=1;i<=100;i++){ | |
| var s = ''; | |
| if (i % 3 === 0) s += 'Fizz'; | |
| if (i % 5 === 0) s += 'Buzz'; | |
| console.log(s ? s : i); | |
| } |