Want to create a Gist from your editor, the command line, or the Services menu? Here's how.
--- | |
layout: nil | |
--- | |
<?xml version="1.0" encoding="utf-8"?> | |
<feed xmlns="http://www.w3.org/2005/Atom"> | |
<title type="text" xml:lang="en">{{ site.root_desc }}</title> | |
<link type="application/atom+xml" href="http://paulstamatiou.com/feed/" rel="self"/> | |
<link type="text" href="http://paulstamatiou.com" rel="alternate"/> | |
<updated>{{ site.time | date_to_xmlschema }}</updated> |
##Setup Textmate for Rails Dev on OS X
This guide was written by Jon Kinney for the Green Bay Ruby User Group. Jon works at Intridea and they graciously sponsor the Green Bay RUG meetings.
These guides were also partially completed using time from Intridea's SparkTime initiative which aims to give employees "outside projects" to work on during their normal work week.
If you find any issues with these suggestions please let me know. I've amassed these tips/tricks over several years of full time Rails development using Textmate but just because it works on my system doesn't always mean it will be problem free universally. Thanks to all the blog authors whose articles helped me learn Textmate over the years but whose links/posts I've lost or forgotten over time. If you have a cool Textmate tip or trick please post it in the comments!
// | |
// | |
// UIColor+GSAdditions.h | |
// | |
// Created by Simon Whitaker at Goo Software Ltd on 15/09/2011. | |
// | |
#import <UIKit/UIKit.h> | |
@interface UIColor (GSAdditions) |
I'm a fan of MiniTest::Spec. It strikes a nice balance between the simplicity of TestUnit and the readable syntax of RSpec. When I first switched from RSpec to MiniTest::Spec, one thing I was worried I would miss was the ability to add matchers. (A note in terminology: "matchers" in MiniTest::Spec refer to something completely different than "matchers" in RSpec. I won't get into it, but from now on, let's use the proper term: "expectations").
Let's take a look in the code (I'm specifically referring to the gem, not the standard library that's built into Ruby 1.9):
# minitest/spec.rb
module MiniTest::Expectations
#!/usr/bin/env ruby | |
# Uses the Readability Metrics API from http://ipeirotis.appspot.com/readability-api.html | |
# Accepts text from STDIN (piped) or as an argument | |
=begin examples | |
pbpaste|text_score.rb # copy text and run (on OS X) to get the stats for the clipboard. | |
cat myfile.md|text_score.rb # get scores for the contents of a file | |
=end | |
require 'open-uri' | |
require 'net/http' |
require './interface' | |
puts to_strings(->(limit) { | |
->(lst) { | |
->(f) { | |
->(f) { | |
->(g) { | |
->(n) { | |
f.(g.(g)).(n) | |
} | |
}.(->(g) { |
OS X Mountain Lion ships with two new apps, Reminders and Notes, which are basically OS X counterparts of the standard iOS apps with the same names. One nice thing about these new apps is that they are scriptable.
This means that I was able to create two simple AppleScripts and thus an Alfred extensions to make a new reminder in the default list and to make a new note in the default folder.
You can view the sources of the AppleScripts below.
$stack, $draws = [], {} | |
def method_missing *args | |
return if args[0][/^to_/] | |
$stack << args.map { |a| a or $stack.pop } | |
$draws[$stack.pop(2)[0][0]] = args[1] if args[0] == :< | |
end | |
class Array | |
def +@ |