A tutorial for the UPL Video Lecture Series
by Leo Rudberg
All of the commands below are prefixed by git and are run inside your (Unix-like) terminal (bash, zsh, etc.).
All of the commands below are prefixed by git and are run inside your (Unix-like) terminal (bash, zsh, etc.).
| # A while back, Major League Hacking (mlh.io) wanted to make a video | |
| # similar to the "I Believe That We Will Win" videos. | |
| # In the video, hackers will say the line, showing off our passion and diversity. | |
| # Being a hacker first, an a normal human second, I took the request as a challenge. | |
| # When I remembered that `say` was a thing in Terminal, I knew what I had to do... | |
| # In this gist (and hopefully a video), I'll explain what my one liner means. | |
| # Hopefully, you'll learn some awesome Ruby tricks along the way. | |
| # If you are new to Ruby, http://feministy.github.io/ruby_basics/#/ is a great start. | |
| # Here's my one-liner: |
| /* | |
| I used this tutorial below to get some nice looking bars to start out with: | |
| http://css-tricks.com/html5-progress-element | |
| Some page-specific code has been redacted, only the meat remains | |
| Don't blame me if this doesn't compile! This meant for education! | |
| */ | |
| const IS_WEBKIT = 'WebkitAppearance' in document.documentElement.style; | |
| const RGB_STR_REGEX = /^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/; |
| # implemented for all real rational numbers | |
| class Float | |
| # determine if a real rational number is zero | |
| # we know a number is zero if one cannot divide another by it | |
| def _is_zero_? | |
| begin | |
| # need to check for any non-zero number | |
| # we might as well put pi in the cache | |
| x = Math::PI.ceil |