Skip to content

Instantly share code, notes, and snippets.

View rossta's full-sized avatar
💭
Being curious

Ross Kaffenberger rossta

💭
Being curious
View GitHub Profile
@rossta
rossta / ABOUT.md
Last active March 12, 2018 21:52
Explaining montrose.rb

Montrose

Montrose is a Ruby gem I wrote to specify and enumerate recurring events in Ruby. The source is hosted on Github.

The why: Dealing with recurring events is hard. Montrose provides a simple interface for specifying and enumerating recurring events as Time objects for Ruby applications.

More specifically, this project intends to:

  • model recurring events in Ruby
  • embrace Ruby idioms
@rossta
rossta / bangbangcon-proposal.md
Last active February 4, 2018 14:35
bangbangcon-proposal.md

Title

Iris! Iris! Iris! The story of the 2004 Texas State Botball Championships

Abstract

It's lunchtime at the all-day Botball competition and, for one group of students, things were not going well. Their robot was malfunctioning. They'd lost every contest in the morning round robin. From other competitors, they received insults and scorn. With the afternoon elimination tournament looming, perhaps it would be easier to quit.

An improbable team from inner-city Houston with enters a state-wide robotics competition. Iris, their captan, is a quiet ninth-grader with a knack for debugging under pressure. Their teacher, a former biology major, learned to program alongside his students in their afterschool robotics club. Together, they embark on impossible quest and emerge transformed.

@rossta
rossta / initializers:hello.js
Last active November 12, 2020 19:45
Webpack with require.context
console.log('initializer hello.js');
@rossta
rossta / serviceworker.js
Last active September 21, 2016 21:43
Service Worker on Rails example
self.addEventListener('fetch', function(event) {
event.respondWith(
caches.open('mysite-dynamic').then(function(cache) {
return cache.match(event.request).then(function (response) {
return response || fetch(event.request).then(function(response) {
cache.put(event.request, response.clone());
return response;
});
});
})

Keybase proof

I hereby claim:

  • I am rossta on github.
  • I am rossta (https://keybase.io/rossta) on keybase.
  • I have a public key ASBcO-l0V-5tVb1-FdQHOO7JBLthnAggypJpXmtFWYs3Mgo

To claim this, I am signing this object:

@rossta
rossta / FLATTEN-REFINEMENT.md
Last active July 19, 2016 21:22
Custom Ruby refinement to demonstrate flattening of an Array with using Array#flatten

FlattenRefinement

A Ruby refinement to demonstrate flattening of a nested array without using Array#flatten. Flattening logic is identical to my original implementation done as a Ruby module.

Exposes Array#custom_flatten when used as a refinement; one advantage to using a refinement is not having to check for non-array argument types. I'd be less inclined to use refinements in a production app given they haven't gained a lot of traction in the Ruby community, but I believe they're good for experimentation.

Usage

using FlattenRefinement
@rossta
rossta / FLATTEN.md
Last active July 19, 2016 15:42
Custom Ruby module to demonstrate flattening of an Array with using Array#flatten

Flatten

A Ruby module to demonstrate flattening of a nested array without using Array#flatten:

Usage

Flatten.flatten([1, [2, [3]]])
=> [1, 2, 3]
@rossta
rossta / offline.html
Last active June 24, 2019 06:16
offline.html
<!DOCTYPE html>
<html>
<head>
<title>You are not connected to the Internet</title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<style>
body {
background-color: #EFEFEF;
color: #2E2F30;
text-align: center;
@rossta
rossta / snake_case.rb
Last active April 9, 2016 12:25
Solution to Ancient City Ruby 2016
# I gave a take about Enumerator at ACR so naturally
# I had to solve the Snake Case challenge using one.
module SnakeCase
module_function
# Returns the number of paths for a
# grid given by m x n blocks
#
# @param m [Fixnum] width
# @param n [Fixnum] length
@rossta
rossta / test.log
Created February 22, 2016 22:31
Pry in Hanami controller
ross@plato [05:27:55][~/dev/rossta/github_groove][master *]
$ bin/rake
Faraday::Builder is now Faraday::RackBuilder.
Run options: --seed 12311
# Running:
.....I, [2016-02-22T17:30:26.738851 #90230] INFO -- : Project sync'd!
......................^Cbefore_session hook failed: Interrupt:
/Users/ross/.gem/ruby/2.1.6/gems/pry-0.10.3/lib/pry/code/loc.rb:28:in `initialize'