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 / index.html
Last active December 14, 2015 11:08
Tweet Calendar
<!doctype html>
<meta charset="utf-8">
<div id="block"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<style type="text/css">
.block {
font: 10px sans-serif;
shape-rendering: crispEdges;
padding: 25px 0;
}
@rossta
rossta / caybara_rails.rb
Created March 25, 2013 16:19
Configuring Capybara RackTest driver for Rails in Capybara 2.0.+
Capybara.register_driver :rack_test do |app|
Capybara::RackTest::Driver.new(app,
redirect_limit: 15,
follow_redirects: true,
respect_data_method: true
)
end
@rossta
rossta / index.js
Last active July 19, 2021 12:15
Barebones node js server on express
var express = require('express');
var app = express.createServer();
app.configure(function() {
var pub = __dirname + "./public";
pub = require("path").normalize(pub);
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
});
@rossta
rossta / ruby_install.sh
Created November 29, 2013 16:21
Bootstrap ruby on remote server
#!/usr/bin/env bash
RUBY_VERSION=ruby-2.0.0-p247
apt-get -y update
apt-get -y install build-essential libyaml-dev zlib1g-dev openssl libssl-dev libreadline-gplv2-dev
cd /tmp
wget ftp://ftp.ruby-lang.org/pub/ruby/2.0/$RUBY_VERSION.tar.gz
tar -xvzf $RUBY_VERSION.tar.gz
cd $RUBY_VERSION/
sudo ./configure --prefix=/usr/local
sudo make
@rossta
rossta / scalable-js-resources.md
Last active August 16, 2025 17:56
Resources for Learning Scalable Javascript Architecture

Scalable JS Resources

Forget what you know about Javascript MVC patterns from your experience with Backbone, Ember, Angular, Knockout, Batman, and yada yada. I encourage you to empty your cup, take a step back and open your mind to the ideas presented in the following resources, primarily from minds of Nicholas Zakas and Addy Osmani, two individuals I consider to be thought leaders in the front-end development world.

@rossta
rossta / find_and_replace.sh
Created February 4, 2014 22:42
Find and replace in directory on the shell
# example: replacing :mocha with :rspec as mock framework
find . -name '*_spec.rb' -exec sed -i.old -e 's/returns/and_return/' {} \;
find . -name '*_spec.rb' -exec sed -i.old -e 's/expects/should_receive/' {} \;
find . -name '*_spec.rb' -exec sed -i.old -e 's/stubs/stub/' {} \;
find . -name '*.old' -exec rm {} \;
@rossta
rossta / flag_datafix.rb
Last active August 29, 2015 13:57
Notes for orphaned flag datafix
# flags orphaned from forum topics (discussions)
Flag.joins("LEFT OUTER JOIN forum_topics ON flags.flaggable_id = forum_topics.id").where('forum_topics.id IS NULL').where(flaggable_type: 'ForumTopic')
# flags orphaned from comments
Flag.joins("LEFT OUTER JOIN comments ON flags.flaggable_id = comments.id").where('comments.id IS NULL').where(flaggable_type: 'Comment')
@rossta
rossta / transliteration.yml
Created May 5, 2014 17:31
Default I18n transliteration converted to YAML
# I18n::Backend::Transliterator::HashTransliterator::DEFAULT_APPROXIMATIONS.to_yaml
---
À: A
Á: A
Â: A
Ã: A
Ä: A
Å: A
Æ: AE
Ç: C
@rossta
rossta / nginx_functions.zsh
Created June 3, 2014 20:10
nginx functions
lsnginx() {
ps -A -o pid,command | grep '[n]ginx'
}
startnginx() {
sudo nginx -c /web/platform/config/nginx/nginx.conf
}
startnginxssl() {
sudo nginx -c /web/platform/config/nginx/nginx.ssl.conf
@rossta
rossta / sunspot.yml
Created June 6, 2014 14:57
Updated sunspot yml
test:
solr:
hostname: localhost
port: 9008
log_level: WARNING
solr_home: solr
development:
solr:
hostname: localhost