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
upstream devpost {
server unix:/web/platform/tmp/sockets/unicorn.sock fail_timeout=0;
}
server { # main app
listen 80;
server_name .devpost.dev;
root /web/devpost/public;
@rossta
rossta / core.cljs
Created September 23, 2015 21:57
Lab notebook WIP
(ns lab-notebook.core
(:require [om.core :as om]
[om.dom :as dom]))
(defonce appstate (atom {}))
(defn item-view [cursor component]
(reify
om/IRender
(render [this]
@rossta
rossta / Dockerfile
Created October 9, 2015 20:52
Basic Rails Dockerfile
FROM ruby:2.2.3
RUN apt-get update -qq
RUN apt-get install -y build-essential libpq-dev nodejs npm nodejs-legacy vim
ENV app /app
RUN mkdir $app
WORKDIR $app
ENV BUNDLE_PATH /box
@rossta
rossta / _ticket.html.erb
Last active February 22, 2016 22:08
Hanami view test error
<article class="ticket">
<h5><%= ticket.title %></h5>
<p>#<%= ticket.number %></p>
<p><%= ticket.summary %></p>
<% if ticket.issue %>
<%= link_to "View issue on Github", ticket.issue.github_url, class: "button small secondary" %>
<% else %>
<p>
<%=
form_for :ticket, routes.ticket_issues_path(ticket.id) do
@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'
@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 / offline.html
Last active October 7, 2025 10:08
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 / 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 / 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

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: