Skip to content

Instantly share code, notes, and snippets.

View freality's full-sized avatar

Ken Love freality

View GitHub Profile
def print_scoreboard(home_team, home_score, away_team, away_score, inning, inning_number, balls, strikes, outs):
print('Game Scoreboard:')
print('Home: {home_team} - {home_score}'.format(home_team=home_team, home_score=home_score))
print('Away: {away_team} - {away_score}'.format(away_team=away_team, away_score=away_score))
print('Inning: {inning_number}/{inning}'.format(inning=inning, inning_number=inning_number))
print('Balls: {balls} / Strikes: {strikes} / Outs {outs}'.format(balls=balls, strikes=strikes, outs=outs))
inning = 'bottom'
inning_number = 7
@freality
freality / fibonacci.js
Last active November 9, 2015 22:02
Fibonacci sequence implemented as ES6 generator (works in Firefox console and Node v 0.12 w/harmony)
function *fibonacci() {
var curr = 1
, last = 0
, x;
yield 1;
while (true) {
x = last + curr;
last = curr;
@freality
freality / README.md
Last active December 17, 2015 15:09 — forked from toddq/README.md
@freality
freality / jquery.replaceclass.js
Created March 27, 2013 18:23
A jQuery method plugin that performs class name replacement.
/**
* jQuery method plugin replaceClass()
*
* Replace a class name with another within a selection.
*
*/
(function ($) {
// Add a method to the jQuery fn object.
$.fn['replaceClass'] = function(needle, replacement) {
return this