Skip to content

Instantly share code, notes, and snippets.

View StevenClontz's full-sized avatar

Steven Clontz StevenClontz

View GitHub Profile
@StevenClontz
StevenClontz / palindromic_integer_powers_of_2
Last active August 29, 2015 13:57
integer powers of 2 which are palindromes
[system] ~
$ irb
irb(main):001:0> (0..10**4).each do |n|
irb(main):002:1* p = 2 ** n
irb(main):003:1> puts p if p.to_s == p.to_s.reverse
irb(main):004:1> end
1
2
4
8

Capybara

save_and_open_page

Matchers

have_button(locator)
@StevenClontz
StevenClontz / pi_approx.md
Last active August 29, 2015 13:58
Finding optimal rational approximations of pi

I've got a beef with Pi "Approximation" Day

March 14 (3.14), often known as Pi Day, is a cute idea. I mean, June 28 would certainly be better, but that's not what this is about.

The chip on my shoulder is the shaft that July 22 (22/7) gets. Pi Approximation Day.

It's an apt description, but it has an odd implication. If 22/7 is a pi approximation, then I guess 3.14 = 157/50 = pi? Yeah okay.

@StevenClontz
StevenClontz / minute.md
Created January 21, 2015 00:49
NYLT Scoutmasters' Minute

That was great, wasn't it? I love campfires. There's just something aobut flame that kind of gets you to thinking.

It can be a campfire, or a candle, a lantern... the flame dancing in the air just draws you in, and can make you think.

So what is a flame? It's something we learn very early in our Scouting career. What are the three ingredients for a flame? (ask for help)

Heat, air, and fuel. Without just one of these, the flame cannot survive. If you lack heat, your flame will just go out. Without air, your flame will choke and be snuffed out. Without fuel, your flame will starve and die away.

I keep talking about how I've been here working for this camp for almost a decade. It's important for you all to know why we're doing this. We aren't paid; in fact, we're each paying to be here, giving up our gas, a week of our paychecks, our time lounging by the pool or playing video games or whatever else we'd otherwise be doing.

@StevenClontz
StevenClontz / main.rb
Last active August 29, 2015 14:16
Probability there is a day on Facebook without a birthday
module Prob
@@cache ||= {}
def probability_of_nonbday day_of_year, number_of_friends
return @@cache[number_of_friends][day_of_year] if
@@cache[number_of_friends] && @@cache[number_of_friends][day_of_year]
@@cache[number_of_friends] ||= {}
return 0 if day_of_year < 0
@@cache[number_of_friends][day_of_year] =
(1-probability_of_nonbday(day_of_year-1,number_of_friends))*
(364.to_f/365)**(number_of_friends-day_of_year) +
@StevenClontz
StevenClontz / agenda.md
Last active August 29, 2015 14:16
AubRUG March Agenda

March Agenda

  • Welcome
  • Announcements
    • Meetup.com and @AubRUG on Twitter
    • RailsConf
    • RailsBridge ATL by RailsGirls
    • OIT Symposium (Mar 4 tomorrow)
    • AubRUG future meetings
  • Talk: Developing Rails in the Cloud (Steven Clontz)
@StevenClontz
StevenClontz / generate.rb
Created March 11, 2015 04:58
progress report generator
require 'csv'
require 'pry'
require 'erb'
class Student
attr_reader :id, :name, :section
attr_accessor :group1,
:group2,
:absences,
:diagnostic,
@StevenClontz
StevenClontz / outline.md
Last active August 29, 2015 14:18
Programming talk at New Hope High School

About the speaker

Steven Clontz is a mathematician and software developer from Auburn, Alabama, and co-founder of the startup Teloga, LLC responsible for Teloga.com for Music Organizations (a customer relationship manager). He is currently developing the open-source learning management system ALMS at https://github.com/StevenClontz/alms.

Open-source

All of the tools I use in my work are open-source: this typically means that

@StevenClontz
StevenClontz / .bash_prompt
Last active September 2, 2020 17:12
Bash Prompt
# set colors for prompt
RED="\[\033[0;31m\]"
YELLOW="\[\033[1;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[1;34m\]"
MAGENTA="\[\033[1;35m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
@StevenClontz
StevenClontz / README.md
Last active May 23, 2016 16:51
MaPP HSC17 Call for Puzzle Designers

MaPP High School Challenge '17

Thank you for your interest in designing a puzzle for Mathematical Puzzle Program's (MaPP) High School Challenge '17 (HSC17)! We provide our mathematical puzzlehunt competition materials to campuses across the country without cost as part of our mission of promoting the fun of mathematical problem solving. Your contributions are what make this possible.

Please read this short document outlining what we need from our volunteer