Skip to content

Instantly share code, notes, and snippets.

View neomindryan's full-sized avatar

Ryan Findley neomindryan

View GitHub Profile
@neomindryan
neomindryan / pandoc
Created April 23, 2018 17:44
Shell script to invoke pandoc within a docker container
#!/bin/bash
# This is inspired by: https://github.com/blang/latex-docker/blob/master/dockercmd.sh
# Number 2 pandoc vm: vbatts/pandoc
# more here: https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q=pandoc&starCount=0
docker run --rm -ti -v "$PWD":/data marcelhuberfoo/pandoc-gitit pandoc "$@"

Keybase proof

I hereby claim:

  • I am neomindryan on github.
  • I am neomindryan (https://keybase.io/neomindryan) on keybase.
  • I have a public key ASDT4U5fdipjM2aXbMbpPzF4u5TMY3jyIxQqHXPiSrG6hAo

To claim this, I am signing this object:

# Add this file to config/initializers in a Rails 2 app
ActiveRecord::Base.class_eval do
# Setup some useful generic scopes
named_scope :ordered, proc{ { :order => primary_key } }
named_scope :where, proc{|*conditions| { :conditions => conditions.size == 1 ? conditions.first : conditions } }
named_scope :joins, proc{|joins| { :joins => Array(joins).join(' ') } }
named_scope :limit, proc{|count| { :limit => count } }
named_scope :offset, proc{|offset| { :offset => offset } }
named_scope :order, proc{|order| { :order => order.to_s } }

Keybase proof

I hereby claim:

  • I am neomindryan on github.
  • I am neomindryan (https://keybase.io/neomindryan) on keybase.
  • I have a public key whose fingerprint is 558A 1BF9 1EBE 90EB 4735 FE5F 5F1F C536 C1EF ADD3

To claim this, I am signing this object:

#!/usr/bin/env ruby
filename = "esopnavigator_production.log"
urls = []
processing_method = {}
File.open filename do |f|
while l = f.gets
if l =~ /.* rails\[([0-9]+)\]: .* Processing .* \[([A-Z]+)\]/
processing_method[$1] = $2
end
@neomindryan
neomindryan / ci
Created November 22, 2010 23:35 — forked from sr/ci
#!/bin/sh
# When building the app from within Integrity, there are environment variables set that make it difficult to use the correct gems.
# This script resets those environment variables, and replaces them with our RVM values.
# This script started its life as a gift from #integrity on irc.freenode.net: http://gist.github.com/560855 (poster named sr)
# This script is specific to a single, complicated client, but it's useful as a reference.
# We're using 1.8.6-head for ci because ruby 1.8.6 has a known issue on Ubunto 64bit that causes date to work improperly
RyBook:nna ryan$ rm -f db/development.sqlite3 && rake db:migrate --trace
(in /Users/ryan/Documents/aptana/neomind/nna)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
rake aborted!
Could not find table 'translations'
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:29:in `table_structure'
/Library/Ruby/Gems/1.8/gems/activesupport-2.1.0/lib/active_support/core_ext/object/misc.rb:28:in `returning'
/Library/Ruby/Gems/1.8/gems/activerecord-2.1.0/lib/active_record/connection_adapters/sqlite3_adapter.rb:28:in `table_structure'