Skip to content

Instantly share code, notes, and snippets.

View LOZORD's full-sized avatar
💭
i'm chillin

Leo Rudberg LOZORD

💭
i'm chillin
View GitHub Profile
@LOZORD
LOZORD / git_tutorial.markdown
Last active August 29, 2015 14:10
UPLVLS: git, GitHub, and you!
@LOZORD
LOZORD / i_believe.rb
Last active August 29, 2015 14:08
An explanation of my one-liner for MLH.
# 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:
@LOZORD
LOZORD / progress_anim.js
Last active August 29, 2015 14:05
Since HTML <progress> bars don't have (non-pseudo) CSS attributes to animate for their width and inner color, I had to break out some nasty JS. Expect an actual library using just vanilla JS some time in the future...
/*
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+)\)$/;
@LOZORD
LOZORD / neg.rb
Created July 16, 2014 04:36
A Rigorous Sign Determining Algorithm For Real Rational Numbers
# 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