Skip to content

Instantly share code, notes, and snippets.

View ohrite's full-sized avatar
💭
🎶 solving everything with pairing

Doc Ritezel ohrite

💭
🎶 solving everything with pairing
View GitHub Profile
@ohrite
ohrite / router.js
Created March 19, 2011 20:33
Route resolver for Rails3 into Backbone-style routes
// Router.js 0.1.0
// (c) 2011 Doc Ritezel
// Freely distributable under the MIT license.
//
// Load this before rails_routes.js (generated by routes_to_javascript.rb)
// Enables:
// var c = new Backbone.Controller({ routes: { Routes.root(): 'index' } });
// $('a.delete').attr('href', Routes.delete_item(3));
(function(){
@ohrite
ohrite / test.sh
Created May 27, 2011 23:40
Doing cascading.multitool scripting with files
#!/usr/bin/env bash
# Copyright (c) 2011 Concurrent, Inc.
mt_path=`pwd`
content=`cat $0 | sed 's/^\s*#.*//g' | tr "\n" " " | sed 's/.*!#//'`
exec $mt_path/bin/multitool `eval echo $content`
!#
# set the source
@ohrite
ohrite / .bash_profile
Created October 25, 2011 00:55
Profile includes for Elastic Beanstalk
for file in $(\ls -1 ${HOME}/.bash_profile_includes/*.sh); do
source $file;
done
@ohrite
ohrite / Mou Twilight.txt
Created October 25, 2011 21:46
Michael Sheets' Twilight (TextMate) for Mou.app
editor
foreground: F8F8F8
background: 141414
caret: A7A7A7
editor-selection
background: 33363a
COMMENT
foreground: 5F5A60
@ohrite
ohrite / gist:1386655
Created November 22, 2011 19:30
ElasticSearch bootstrap
> container:start
[info] jetty-7.4.5.v20110725
[info] NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
[info] started o.e.j.w.WebAppContext{/,[file:...]}
11:19:17.307 [pool-6-thread-8] INFO d.elasticsearch.servlet.NodeServlet - Initializing elasticsearch Node 'elasticsearchNode'
11:19:17.310 [pool-6-thread-8] DEBUG d.elasticsearch.servlet.NodeServlet - Initializing elasticsearch Node in development mode
11:19:17.310 [pool-6-thread-8] DEBUG d.elasticsearch.servlet.NodeServlet - ElasticSearch node using path.home=./temp
11:19:17.379 [pool-6-thread-8] INFO org.elasticsearch.node - [Stallior] {0.18.4}[6798]: initializing ...
11:19:17.385 [pool-6-thread-8] INFO org.elasticsearch.plugins - [Stallior] loaded [], sites []
11:19:17.723 [pool-6-thread-8] TRACE org.elasticsearch.monitor - failed to load sigar
@ohrite
ohrite / sample.sh
Created September 15, 2012 20:28
A sample snowflake module
sample () {
case "$1" in
test)
echo "Successfully ran sample test!"
;;
*)
return 1
;;
esac
}
@ohrite
ohrite / application.js
Created March 30, 2013 22:24
Hey Kids, try this at home!
// Your Javascript will go here!
function randomValue() {
return 127 + Math.floor(Math.random() * 128);
}
$(document).ready(function() {
/* Add code from the next steps here. */
$(document).keydown(function(event) {
var color = [randomValue(), randomValue(), randomValue()];
$('body').css('background-color', 'rgb(' + color.join(',') + ')');
@ohrite
ohrite / gist:9615156
Created March 18, 2014 07:28
Better Code Review - Abstract
Do your team's technical discussions devolve into tense confrontations? Are you frequently confused by other people's code changes? Is there someone who you just can't seem to get along with? Software peer review on a modern development team is essential to healthy code and a happy team. But it's riddled with human-sized pitfalls. Learn why talking about code in person is important, how to talk about code without burning bridges, and most importantly, how to take dread out of your workplace.
@ohrite
ohrite / gist:ffb979063e0d970f2037e2981970ce9e
Created July 15, 2021 19:09
Setting up Teaspoon with Webpacker
# Gemfile
group :test do
gem 'webdrivers'
end
# app/packs/spec.js
const specContext = require.context("../../spec/javascript", true, /_spec\.js$/)
specContext.keys().forEach(specContext)
@ohrite
ohrite / starship.toml
Created July 19, 2021 17:31
Ministry of Velocity Starship Configuration
command_timeout = 1000
format = """
$time\
$username\
$shlvl\
$kubernetes\
$red\
$ruby\
${custom.rbenv_gemset}\
$hostname\