Here is a useful bundle for testing out ruby snippets. It includes a
script from eigenclass.org[1].
⌘= insert/remove an eval marker for the current line
⌘E evaluates and annotate the file according to the markers
If there are errors they are placed at the end of the file.
Examples (after eval):
(1..10).each do |i|
i ** i # => 1, 4, 27, 256, 3125, 46656, 823543, 16777216,
387420489, 10000000000
end
(1..10).to_a # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
Unfortunately you can't do something like this:
(1..10).each do |i|
i ** i
end # =>
[1]: http://eigenclass.org/hiki.rb?xmp+redux%3A+expanding+test
+assertions+for+profit
-- Daniel
Hi there.
When you preview web pages containing iframes that drag in
information from the web, the frame displays as filled with unicode
characters (instead of the programmed content).
You can see this by viewing this email in textmate (cntrl-cmd-E).
Compare that to what you get if you view the email in safari (you
can't just view, as it will have a .mail extension - reveal in finder
and toggle this to html then double click.
<iframe src="http://rcm.amazon.com/e/cm?
t=thewizardsoft-20&o=1&p=8&l=as1&asins=B000BW7QWW�
38;fc1=000000&IS2=1&lt1=_blank&lc1=0000ff&bc1=ffffff
&bg1=ffffff&f=ifr" style="width:120px;height:240px;"
scrolling="no" marginwidth="0" marginheight="0" align=right
frameborder="0">
</iframe>
Last week I posted about a little tool I made to allow editing of SQL
data within textmate.
I've turned this program into a bundle, which you can download here:
http://vivified.net/files/downloads/SQLEdit-bundle-09.zip
See the help command for more information.
It seems to require Ruby 1.8.4, why this is I'm not sure yet. I'm
very much a ruby newbie.
Also, I can't seem to get rid of the HTML output window as I need the
edit process to be run in a separate
window from the main textmate window (otherwise it freezes and I
can't load anything into it). Is there a
way to spawn a new background process, and then end my initial
textmate command process?
Anyway, I'd love to hear if anyone finds this useful. I myself use it
to edit my Textpattern site's templates,
as they are all stored inside the database.
Cheers,
Bastiaan
Just to give back a little, I made a change to the Tidy command in the
HTML bundle (actually, made a new bundle and copied code and changed
it.)
When running the stock Tidy HTML command on an HTML document that was
created by saving a Microsoft Word document as HTML, it completely
deletes the contents document! In my duplicate of the Tidy command, I
added an option for Tidy to know it's dealing with a Word document.
I added: --word-2000 yes to the tidy command in the bundle. The
first few lines now are:
"${TM_TIDY:-tidy}" -f /dev/null -iq -utf8 -asxhtml -wrap 0 --tab-size
$TM_TAB_SIZE --word-2000 yes --indent-spaces $TM_TAB_SIZE
${TM_SELECTED_TEXT:+--show-body-only yes}|\
Now it cleans all of the extra MS junk that's added to a document.
There's still a little clean up to do (it doesn't delete the
<o:p></o:p> useless tags, but that's easy to do.)
Hope this helps someone!
jt
Hi,
I have created a few commands that are analogous to the Subversion
commands which diff against a revision, but instead of generating a
diff output, the result is sent to FileMerge for viewing, which IMHO
is a whole lot easier to read.
The commands look like this:
-------------
require_cmd "${TM_SVN:=svn}" "If you have installed svn, then you
need to either update your <tt>PATH</tt> or set the <tt>TM_SVN</tt>
shell variable (e.g. in Preferences / Advanced)"
require_cmd opendiff "You must install the Apple developer tools to
run FileMerge."
"$TM_BUNDLE_SUPPORT/bin/filemerge.sh" BASE "$TM_FILEPATH"
-------------
filemerge.sh looks like this:
-------------
#!/bin/sh
#
# $1 = svn revision
# $2 = full path to file ($TM_FILEPATH)
# First see if the file is under svn control
FILE=`basename "$2"`
INFO_LINES=`svn info 2>&1 > /dev/null | wc -l`
if [ $INFO_LINES -eq 2 ]; then
echo "The current file is not under subversion control"
exit 206
fi
SIZE=`svn diff -r $1 "$2" | wc -m`
if [ $SIZE -eq 0 ]; then
echo "No difference"
exit 206
fi
INODE=`stat -f "%i" "$2"`
TMPPATH="/tmp/tm-opendiff-$INODE.tmp"
svn cat -r $1 "$2" > "$TMPPATH"
opendiff "$TMPPATH" "$2"
-----------
To create a command for a different revision, change BASE in the
command to something else (e.g. HEAD or PREV).
Regards,
Aparajita
www.aparajitaworld.com
"If you dare to fail, you are bound to succeed."
- Sri Chinmoy | www.srichinmoylibrary.com
hi,
I know that it has been discussed before -- but I have yet to find the
command or step(s) to effectively translate high-ascii characters -- like
emdashes and smart quotes -- that were written in Word tr html.
I still have stuff like the following:
s in three statesâ€"New Hampshire, Washington, and Coloradoâ€"that are
any tips?
--
dc
-----
David Clark
Web Specialist
Institute for Community Inclusion (http://www.communityinclusion.org/)
david.clark(a)umb.edu
(617) 287-4318
Hi all,
Sorry for this - it's probably something very obvious that I'm
missing - it might be a default Mac feature that I'm not aware of.
Here's the situation...
I want to check a file into subversion. I hit Shift+Control+a and
select Commit. I enter my comment in the Summary of changes panel.
Now I want to 'hit' the Commit button without my hands leaving the
keyboard (i.e. not using the mouse). I've tried every key combo I can
think of, but I couldn't find one. Anyone?
P.S. Allan, I absolutely _love_ TextMate. I would buy a Mac just to
use this program.
Carpe viam,
Mike
Michael Larocque
Chief Cook and Bottle Washer
Prolumina Communications Inc.
http://prolumina.com/~mlarocque/
I would be very very very very happy if there was a way to have a
TextMate textview totally replace the Xcode editor. I'm sure others
have asked for this, but searching through the list was painful on my
slow-ass internet connection, so I make the request here.
The idea is that you could write a SIMBL wrapper or an Xcode plugin
wrapper (the API, though private, has been documented) around a
subclass of the Xcode TextView (a dump of the framework - used to be
called PBX.framework or some such would garner the class) and then
basically do a poseAs.
I, for one, would certainly be willing to pay for this feature. That
is, I already own TM, and I would happily buy another license for
this product for $40. What are the odds, difficulties, etc of this?
vinayvenkatesh
When I try to execute a SVN command I get this error:
/bin/bash: line 1: require_cmd: command not found
Then most of the commands work fine except for svn status that gives no output.
Any clue? I already checked the various enviroment variables but
everything seems ok.
(I am using TextMate 1.5.1 (961) on Mac OS X 10.4.6.)
I see in the archives that Ke Han asked for a "bracket matching
feature" on 8th March (http://lists.macromates.com/pipermail/textmate/
2006-March/008927.html) wherein a user could double-click on a
bracket to select the enclosing content (ala BBEdit) but that the
only way to reproduce this behaviour is via the shift-cmd B "Select
Enclosing Brackets" command.
Is there any way for me to implement this behaviour as I would
greatly appreciate being able to select the contents of an entire
bracket so easily? If not, is there any chance of it appearing in a
future release of TextMate? My main use would be to quickly identify
where the closing (or opening) bracket for some code lies.
On another note, I have noticed what I believe is a bug when shifting
lines left and right:
Shifting a line to the left moves the cursor one character to the
right and shifting a line to the right shifts the cursor one
character to the left when I expected the cursor to remain relatively
stationary. More noticeably, this means that if the cursor was at the
end of the line and the user shifts left, the cursor goes to the next
line.
Thanks in advance,
-- Paul