Back in Melbourne circa 2010/11, Jodie, Jared and I used to run a [monthly vegan mentoring group][vegan-month]. I have gone back through the mailing lists and collected much of the curriculum and information from the program into this single document, so that I can distribute it more widely. The program was designed not just to get you through the first month nutritionally, but to expose you to a variety of foods and ideas that may be new to you. It emphasises that veganism is a shift sideways, not a sacrifice.
# `git merge-log` shows the commits that were introduced in a given merge | |
# `git merge-diff` shows the actual changes that were introduced by a given merge | |
# Both commands accept an optional commitish; if ommitted, the last merge commit is used | |
merge-span = "!f() { echo $(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f1)$1$(git log -1 $2 --merges --pretty=format:%P | cut -d' ' -f2); }; f" | |
merge-log = "!git log `git merge-span .. $1`" | |
merge-diff = "!git diff `git merge-span ... $1`" | |
merge-difftool = "!git difftool `git merge-span ... $1`" |
Chances are your head's spinning right now. That accusation of bias caught you off guard, you got kind of defensive, and now all hell has broken loose. You're feeling attacked on all sides. You're a good person at heart, and having all these people treat you like the antichrist is pretty upsetting.
You need to say something, but you're probably not in the best headspace to write copy right now. So to help you along, here's my 100% guaranteed-or-you-money-back scandal defusement apology template:
The following is an explanation of Ruby blocks and yield by another Bloc mentor (Adam Louis) who was trying to explain it to one of his students.
On my very first day programming, if someone asked me for "the sum of the numbers from 1 to 10", I'd have written:
puts 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10
Easy enough.
namespace :assets do | |
task :check do | |
root_dir = File.join(File.dirname(__FILE__),"..","..") | |
assets_last_modified_at = Dir["#{root_dir}/app/assets/**/**"].map { |p| File.mtime(p) }.sort.last | |
assets_last_compiled_at = Dir["#{root_dir}/public/assets/**/**"].map { |p| File.mtime(p) }.sort.last | |
if assets_last_modified_at > assets_last_compiled_at | |
fail "Assets need to precompiled; last asset modified at #{assets_last_modified_at}" | |
end | |
end |
Integration testing is awesome. Years ago, running integration tests was painful, slow, and they were so brittle that every change to the codebase broke the test suite.
Today it's a different story. We have amazing tools that make a tough job much easier. Let's check them out.
Integration tests are critically important because they exercise your application just like a real user. They therefore depend on the full stack from your models up through your controllers, helpers, view templates, web server, database, and middleware.
require 'spec_helper' | |
require 'parslet/rig/rspec' | |
require 'tv_show_parslet' | |
describe TvShowParslet do | |
let(:parser) { described_class.new } | |
def p(string) | |
parse(string, :trace => true) |
"I am a freelance Ruby and Rails developer". When I talk with my geek friends, everyone understands what I do and they have a reasonable understanding of how I spend my day. But sometimes, less technical people ask me what I do for a living and then I tend to dumb down the answer: "I am a programmer, I usually build websites.". Oh -they say- my nephew also make websites, he even built me a blog in Blogger.
Err... yes, but that hardly has anything to do with what I do for a living.
There are many different kinds of websites, built with different technologies, and depending on the site and the technology used to build it, they are made by one kind of professional or another. The craft of building a website comprises many different disciplines, and professionals usually specialize in just one part of the process. Although I do many different things, my specialization is mainly programming dynamic websites using Ruby and Rails.
In this article I want to
√ Zephyros (window manager) needs universal access: | |
http://www.tekrevue.com/2013/06/25/how-to-enable-access-for-assistive-devices-in-os-x-mavericks/ | |
√ gcc can’t find stdio.h (& similar) - /usr/include got blown away | |
xcode-select --install | |
see https://github.com/mxcl/homebrew/issues/20427 | |
√ java install got blown away & replaced with a stub that says to download java | |
http://www.oracle.com/technetwork/java/javase/downloads/jdk7-downloads-1880260.html |
Performance is often ignored in Rails development until it becomes a problem. If ignored too long, though, it can get very tricky to improve. It's valuable to regularly audit performance and look for hotspots or design choices that are slowing things down.
Inspecting the log will help identify the source of several performance issues the application may have.
The Rails application log outputs the time spent processing each request. It breakdowns the time spent at the database level as well processing the view code. In development mode, the logs are displayed on STDOUT where the server is being run. In a production setting the logs will be in log/production.log
within the application's root directory.