I hereby claim:
- I am jrichter on github.
- I am jrichter (https://keybase.io/jrichter) on keybase.
- I have a public key whose fingerprint is D527 3F3F EDB4 AC06 F20F E573 4E75 DD5F 50A9 12B9
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
def self.read_files_and_create_reports | |
@filenames = [] | |
pids = [] | |
dir = "public/txt_reports" | |
Dir.foreach(dir) do |entry| | |
if entry.include? ".txt" | |
@filenames << entry | |
end | |
end | |
do_work_concurrently(@filenames, dir, 2) |
This is neat. Here is my erb file. | |
<% content_for :sidebar do %> | |
<%= link_to 'New user', new_user_path %> | |
<% end %> | |
<h1>Listing users</h1> | |
<% @users.each do |user| %> | |
<% if user.sessions.size > 0 %> | |
<p class="logged_in"> |
<?xml version="1.0" encoding="UTF-8"?> | |
<!-- | |
This is a smashup by Justin Richter of html.lang and ruby.lang | |
html.lang | |
Authors: Marco Barisione, Emanuele Aina | |
Copyright (C) 2005-2007 Marco Barisione <barisione@gmail.com> | |
Copyright (C) 2005-2007 Emanuele Aina | |
ruby.lang | |
Author: Archit Baweja <bighead@users.sourceforge.net> | |
Copyright (C) 2004 Archit Baweja <bighead@users.sourceforge.net> |
Emacs Rails | |
C-c n Goto Mailer | |
C-c z '' RSpec Fixture | |
C-c x '' Fixture | |
C-c c '' Controller | |
C-c g '' Migration | |
C-c r '' RSpec | |
C-c u '' Unit Test | |
C-c m '' Model |
#--- | |
# Excerpted from "Programming Ruby 1.9", | |
# published by The Pragmatic Bookshelf. | |
# Copyrights apply to this code. It may not be used to create training material, | |
# courses, books, articles, and the like. Contact us if you are in doubt. | |
# We make no guarantees that this code is fit for any purpose. | |
# Visit http://www.pragmaticprogrammer.com/titles/ruby3 for more book information. | |
#--- | |
# I modified this code a little |
def do_work_concurrently(number_of_workers = 5) | |
config = ActiveRecord::Base.remove_connection | |
max = number_of_workers | |
pids = [] | |
any_work = true | |
while any_work do | |
# Don't forget to set any_work to false to exit the loop | |
pids << fork_with_new_connection(config) { |
;; Load a custom theme | |
(load-theme 'sanityinc-tomorrow-eighties t) | |
;; Make compilation window not steal a buffer | |
(setq special-display-buffer-names | |
'("*compilation*")) | |
(setq special-display-function | |
(lambda (buffer &optional args) | |
(split-window) |
# justin.zsh-theme | |
# Most of this was taken from | |
# http://blog.andrewhays.net/love-your-terminal which was taken from | |
# http://stevelosh.com/blog/2010/02/my-extravagant-zsh-prompt/ | |
# Also some of this was taken from josh.zsh-theme | |
# Determine what character to use in place of the '$' for my prompt. | |
function repo_char { | |
git branch >/dev/null 2>/dev/null && echo "%(?,%{%F{green}%},%{%F{red}%})∩%{$reset_color%}" && return | |
echo "%(?,%{%F{green}%},%{%F{red}%})⚡%{$reset_color%}" |
data:text/html, <title>Ruby Mode Text Editor</title><style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script> |