Skip to content

Instantly share code, notes, and snippets.

View alexvollmer's full-sized avatar

Alex Vollmer alexvollmer

View GitHub Profile
#!/usr/bin/env ruby
identifying_attrs = {
updateable_type: 'Contact',
updateable_id: 123,
external_source_id: 123,
attribute_name: 'title'
}
non_identifying_attrs = {
@alexvollmer
alexvollmer / run-test-script
Created April 11, 2012 23:25
Wrapper script for running UIAutomation from the command-line
#!/usr/bin/env ruby -wKU
require "fileutils"
require "pty"
unless ARGV.length == 3
STDERR.puts "USAGE: run-test-script <app bundle> <test script> <output directory>"
exit 1
end
Loading site data...
Compiling site...
+--- /!\ ERROR /!\ -------------------------------------------+
| An exception occured while running nanoc. If you think this |
| is a bug in nanoc, please do report it at |
| <http://projects.stoneship.org/trac/nanoc/newticket> -- |
| thanks in advance! |
+-------------------------------------------------------------+
#!/usr/bin/env macruby -wKU
framework 'CoreData'
def dump_mom(mom_path, out)
mom = NSManagedObjectModel.alloc.initWithContentsOfURL(mom_path)
mom.entities.sort_by {|e| e.name}.each do |entity|
out.puts "-" * 80
out.puts entity.name
Cocoa Is My Girlfriend — http://www.cimgf.com
Cocoa with Love — http://cocoawithlove.com/
Mac Developer Network Blog — http://www.mac-developer-network.com
Matt Legend Gemmell's Blog — http://mattgemmell.com
Mobile Orchard — http://www.mobileorchard.com
#!/usr/bin/env ruby
require "rubygems"
require "rubygems/command_manager"
cm = Gem::CommandManager.instance
commands = cm.instance_variable_get(:@commands).keys.map { |c| cm[c.to_s] }
commands.sort_by{ |c| c.command }.each do |command|
options = command.instance_variable_get(:@option_groups)
@alexvollmer
alexvollmer / _gem
Created August 8, 2009 17:49
zsh completion for rubygems
#compdef gem gem1.9
gem_general_flags=("(-h --help)"{-h,--help}"[Get help on this command]"
"(-V --verbose)"{-V,--verbose}"[Set the verbose level of output]"
"(-q --quiet)"{-q,--quiet}"[Silence commands]"
"--config-file[Use this config file instead of default]:file:_files"
"--backtrace[Show stack backtrace on errors]"
"--debug[Turn on Ruby debugging]"
$nul_arg
)
= Technical Interviews: Epic Fail for Everyone
== Description
The standard technical interview process is failing both employers and candidates.
They prevent each party from effectively evaluating each other and often turn away
qualified candidates. This talk will highlight the flaws of technical interviews and
present ideas to radically improve them for everyone.
== Abstract
Let's face it: we all hate the interviewing process, whether we are asking or
answering the questions. Technical interviews often devolve into solving absurd
# SOLUTION: just use the StringIO class and replace Kernel#rand with a fixture method. We're
# not interested in testing how rand works so explicitly setting the value is fine.
class Quiz
def initialize(input = STDIN, output = STDOUT)
@input = input
@output = output
end
def problem
first = rand(10)
(if (equal system-type 'darwin)
(progn
(setq one-buffer-one-frame nil)
(cua-mode 0)
(setq mac-command-modifier 'meta)
(setq x-select-enable-clipboard t)
(set-variable 'default-buffer-file-coding-system 'mac-roman-unix)
(set-default-coding-systems 'mac-roman-unix)
(set-selection-coding-system 'mac-roman)
(set-keyboard-coding-system 'mac-roman)