All those who wander are not lost.

Category: work Page 21 of 24

Working Remotely with Textmate

From: Rob McBroom textmate@…
Subject: working with “remote projects”
Newsgroups: gmane.editors.textmate.general
Date: 2007-04-12 18:06:44 GMT (3 weeks, 5 days, 17 hours and 2 minutes ago)

Inspired by a [recent thread][1], I’ve come up with a couple of
commands to facilitate using TextMate’s project features on a remote
directory. To sum up, the problem is: I want to work with files in a
TextMate project from the local filesystem (for speed, Subversion
compatibility, and other reasons), but the files I’m working on are
useless unless they’re on some remote machine.

I say “remote projects” in quotes because the project is actually
local, but created from a directory that is intended to be an exact
copy of one from a remote machine. The commands are similar in spirit
to some of Dreamweaver’s “Site” features, for those who care about
such things. I’ve been using these commands pretty heavily on a
project at work and am pleased with the results, so I thought I’d share.

The two commands are “Get Remote Project” and “Upload Project
Changes”. The commands have a global scope (ideally, they would be
scoped to “files that belong to a project”, but I don’t know if
that’s possible). They essentially save all files and call rsync - au on your directory in different directions. The basic process is
that you create a project in TextMate from a local directory, then
set a variable in that project called WHERE_I_CAME_FROM that
contains a location rsync understands, like `user

server:/remote/ path`. When you’re ready to see the changes on the server, use the “Upload Project Changes” command. ## Setting up a project Here are two ways to set up such a project: (Note the trailing / on the rsync “source” path. It matters.) * Get the files and create the project 1. Make a local copy mkdir foo rsync -au user server:/remote/path/ foo 2. Open the directory as a project in TextMate mate foo 3. Set `WHERE_I_CAME_FROM` in the project to `user server:/ remote/path/` 4. Save the project * Create the project and get the files 1. Create and open the project in TextMate mkdir foo mate foo 2. Set `WHERE_I_CAME_FROM` in the project to `user server:/ remote/path/` 3. Run the “Get Remote Project” command (currently ⌃⌘P) 4. Watch your files appear in the drawer 5. Save the project I prefer the second method right now, but if the final two steps in the first method could be automated (set a project variable and save the project), the whole process could be turned into a shell script, or possibly a command in TextMate. ## Subversion I haven’t had any issues using this method when the remote directory in question is a Subversion working copy. You basically end up with another working copy (and it’s normal with Subversion to have working copies spread everywhere, so this is no big deal). I’ve been doing commits and other modifications to the working copy locally and have had no issues using rsync to update the remote side afterward (although, theoretically, you could acheive the same thing by running `svn update` on the remote copy). ## Outstanding Issues * Deleted files If you delete a file from your disk/project, the deletion won’t be replicated. You need to either remove the file in both places manually, or if using Subversion `svn update` the other end after the removal has been committed to the repository. There is a `–delete` option in rsync, but I consider it too dangerous to be on by default. * Keyboard Shortcut ⌃⌘P wasn’t my first choice. I’m open to suggestions. According to the manual, project related shortcuts should use ⌃⌘, but I don’t think this has been stricly followed which made it hard to find something. There are other commands using ⌃⌘P and since they have a more specific scope than these “remote project” commands, they will win in those scopes. As for overriding ⌘S to run these commands, that would be convenient in many situations, but innappropriate in most. The commands really only need to be used if you’re in a project and `WHERE_I_CAME_FROM` is set, so it wouldn’t really be appropriate to have ⌘S trigger them unconditionally as they currently exist. * Extended Attributes If you’re going from Mac to Mac, you might consider adding the – E option to the rsync command to be sure metadata is included. It’s not there by default because most of my remote machines are running Solaris and -E makes rsync on Solaris poop in its pants. Perhaps there should be another variable that could be set in TextMate or a specific project that holds your preferred rsync options for these commands. * Project variable name I’m sure I should use something more grown-up sounding than `WHERE_I_CAME_FROM` in the long run, but what? I didn’t see any naming conventions for project variables in the manual. Are `TM_*` variables meant to be only things that the application is aware of or should all TextMate specific variables start with that? ## Other commands? I’ve thought about adding a TextMate command that will do an `svn update` on the remote path. This would be for deleted files or for people who aren’t comfortable updating the various `.svn` directories using rsync (I know you’re out there). I’ve also considered adding a command that will run `rsync -aun` in both directions to show you what will happen if you run one of the commands without actually making the changes. Would either of these be useful? If you have need for something like this, try these commands out and let me know what you think. Thanks. [1]: http://thread.gmane.org/gmane.editors.textmate.general/18573 — Rob McBroom I didn’t “switch” to Apple… my OS did.

Markdown Cheat Sheet

Phrase Emphasis

*italic* **bold** _italic_ __bold__

Links

Inline: An [example](http://url.com/ "Title"). Reference-style labels (titles are optional): An [example][id]. Then, anywhere else in the doc, define the link:

[id]: http://example.com/ "Title"

Images

Inline (titles are optional): ![alt text](/path/img.jpg "Title") Reference-style: ![alt text][id]. Elsewhere [id]: /url/to/img.jpg "Title".

Headers

Setext-style:

`Header 1

Header 2 ——–`

atx-style (closing #’s are optional):

`# Header 1 #

Header 2

Header 6`

Lists

Ordered, without paragraphs:

`1. Foo

  1. Bar`

Unordered, with paragraphs:

* A list item.

With multiple paragraphs, you can nest them:

`* Abacus

  • answer
  • Bubbles
    1. bunk
    2. bupkis
      • BELITTLER
    3. burper
  • Cunning`

Blockquotes

`> Email-style angle brackets

are used for blockquotes.

And, they can be nested.`

`> #### Headers in blockquotes

  • You can quote a list.
  • Etc.`

Code Spans

<code> spans are delimited by backticks.

You can include literal backticks like `this`.

Preformatted Code Blocks

Indent every line of a code block by at least 4 spaces or 1 tab.

This is a normal paragraph.

This is a preformatted
code block.

Horizontal Rules

Three or more dashes or asterisks:

---

* * *

Manual Line Breaks

End a line with two or more spaces:

Roses are red, Violets are blue.

Tape-free Gift Wrapping

Because sometimes you just need to know these things: tape-free gift wrap.

wrapping

Oniguruma Regular Expressions

Version 5.3.0 2006/11/20

syntax: ONIG_SYNTAX_RUBY (default)

  1. Syntax elements

\ escape (enable or disable meta character meaning) | alternation (…) group […] character class

  1. Characters

\t horizontal tab (0x09) \v vertical tab (0x0B) \n newline (0x0A) \r return (0x0D) \b back space (0x08) \f form feed (0x0C) \a bell (0x07) \e escape (0x1B) \nnn octal char (encoded byte value) \xHH hexadecimal char (encoded byte value) \x{7HHHHHHH} wide hexadecimal char (character code point value) \cx control char (character code point value) \C-x control char (character code point value) \M-x meta (x|0x80) (character code point value) \M-\C-x meta control char (character code point value)

(* \b is effective in character class […] only)

  1. Character types

. any character (except newline)

\w word character

       Not Unicode:
         alphanumeric, "_" and multibyte char. 

       Unicode:
         General_Category -- (Letter|Mark|Number|Connector_Punctuation)

\W non word char

\s whitespace char

       Not Unicode:
         \t, \n, \v, \f, \r, \x20

       Unicode:
         0009, 000A, 000B, 000C, 000D, 0085(NEL), 
         General_Category -- Line_Separator
                          -- Paragraph_Separator
                          -- Space_Separator

\S non whitespace char

\d decimal digit char

       Unicode: General_Category -- Decimal_Number

\D non decimal digit char

\h hexadecimal digit char [0-9a-fA-F]

\H non hexadecimal digit char

Character Property

* \p{property-name}
* \p{^property-name}    (negative)
* \P{property-name}     (negative)

property-name:

 + works on all encodings
   Alnum, Alpha, Blank, Cntrl, Digit, Graph, Lower,
   Print, Punct, Space, Upper, XDigit, Word, ASCII,

 + works on EUC_JP, Shift_JIS
   Hiragana, Katakana

 + works on UTF8, UTF16, UTF32
   Any, Assigned, C, Cc, Cf, Cn, Co, Cs, L, Ll, Lm, Lo, Lt, Lu,
   M, Mc, Me, Mn, N, Nd, Nl, No, P, Pc, Pd, Pe, Pf, Pi, Po, Ps,
   S, Sc, Sk, Sm, So, Z, Zl, Zp, Zs, 
   Arabic, Armenian, Bengali, Bopomofo, Braille, Buginese,
   Buhid, Canadian_Aboriginal, Cherokee, Common, Coptic,
   Cypriot, Cyrillic, Deseret, Devanagari, Ethiopic, Georgian,
   Glagolitic, Gothic, Greek, Gujarati, Gurmukhi, Han, Hangul,
   Hanunoo, Hebrew, Hiragana, Inherited, Kannada, Katakana,
   Kharoshthi, Khmer, Lao, Latin, Limbu, Linear_B, Malayalam,
   Mongolian, Myanmar, New_Tai_Lue, Ogham, Old_Italic, Old_Persian,
   Oriya, Osmanya, Runic, Shavian, Sinhala, Syloti_Nagri, Syriac,
   Tagalog, Tagbanwa, Tai_Le, Tamil, Telugu, Thaana, Thai, Tibetan,
   Tifinagh, Ugaritic, Yi
  1. Quantifier

greedy

?       1 or 0 times
*       0 or more times
+       1 or more times
{n,m}   at least n but not more than m times
{n,}    at least n times
{,n}    at least 0 but not more than n times ({0,n})
{n}     n times

reluctant

??      1 or 0 times
*?      0 or more times
+?      1 or more times
{n,m}?  at least n but not more than m times  
{n,}?   at least n times
{,n}?   at least 0 but not more than n times (== {0,n}?)

possessive (greedy and does not backtrack after repeated)

?+      1 or 0 times
*+      0 or more times
++      1 or more times

({n,m}+, {n,}+, {n}+ are possessive op. in ONIG_SYNTAX_JAVA only)

ex. /a*+/ === /(?>a*)/
  1. Anchors

^ beginning of the line $ end of the line \b word boundary \B not word boundary \A beginning of string \Z end of string, or before newline at the end \z end of string \G matching start position

  1. Character class

^… negative class (lowest precedence operator) x-y range from x to y […] set (character class in character class) ..&&.. intersection (low precedence at the next of ^)

ex. [a-w&&[^c-g]z] ==> ([a-w] AND ([^c-g] OR z)) ==> [abh-w]
  • If you want to use ‘[‘, ‘-‘, ‘]’ as a normal character in a character class, you should escape these characters by ‘\’.

POSIX bracket ([:xxxxx:], negate [:^xxxxx:])

Not Unicode Case:

  alnum    alphabet or digit char
  alpha    alphabet
  ascii    code value: [0 - 127]
  blank    \t, \x20
  cntrl
  digit    0-9
  graph    include all of multibyte encoded characters
  lower
  print    include all of multibyte encoded characters
  punct
  space    \t, \n, \v, \f, \r, \x20
  upper
  xdigit   0-9, a-f, A-F
  word     alphanumeric, "_" and multibyte characters

Unicode Case:

  alnum    Letter | Mark | Decimal_Number
  alpha    Letter | Mark
  ascii    0000 - 007F
  blank    Space_Separator | 0009
  cntrl    Control | Format | Unassigned | Private_Use | Surrogate
  digit    Decimal_Number
  graph    [[:^space:]] && ^Control && ^Unassigned && ^Surrogate
  lower    Lowercase_Letter
  print    [[:graph:]] | [[:space:]]
  punct    Connector_Punctuation | Dash_Punctuation | Close_Punctuation |
           Final_Punctuation | Initial_Punctuation | Other_Punctuation |
           Open_Punctuation
  space    Space_Separator | Line_Separator | Paragraph_Separator |
           0009 | 000A | 000B | 000C | 000D | 0085
  upper    Uppercase_Letter
  xdigit   0030 - 0039 | 0041 - 0046 | 0061 - 0066
           (0-9, a-f, A-F)
  word     Letter | Mark | Decimal_Number | Connector_Punctuation
  1. Extended groups

(?#…) comment

(?imx-imx) option on/off i: ignore case m: multi-line (dot(.) match newline) x: extended form (?imx-imx:subexp) option on/off for subexp

(?:subexp) not captured group (subexp) captured group

(?=subexp) look-ahead (?!subexp) negative look-ahead (?<=subexp) look-behind (?<!subexp) negative look-behind

                 Subexp of look-behind must be fixed character length.
                 But different character length is allowed in top level
                 alternatives only.
                 ex. (?<=a|bc) is OK. (?<=aaa(?:b|cd)) is not allowed.

                 In negative-look-behind, captured group isn't allowed, 
                 but shy group(?:) is allowed.

(?>subexp) atomic group don’t backtrack in subexp.

(?

subexp) define named group (All characters of the name must be a word character.) Not only a name but a number is assigned like a captured group. Assigning the same name as two or more subexps is allowed. In this case, a subexp call can not be performed although the back reference is possible. 8. Back reference \n back reference by group number (n >= 1) \k back reference by group name In the back reference by the multiplex definition name, a subexp with a large number is referred to preferentially. (When not matched, a group of the small number is referred to.) * Back reference by group number is forbidden if named group is defined in the pattern and ONIG_OPTION_CAPTURE_GROUP is not setted. back reference with nest level \k n: 0, 1, 2, … \k n: 0, 1, 2, … Destinate relative nest level from back reference position. ex 1. /\A(? |.|(?:(?.)\g\k))\z/.match(“reer”) ex 2. r = Regexp.compile( \g \g* \g ){0} (? \s* > ){0} (? [a-zA-Z_:]+ ){0} (? [^ | [^ \k >){0} \g __REGEXP__ p r.match(‘ fbbbf’).captures 9. Subexp call (“Tanaka Akira special”) \g call by group name \g call by group number (n >= 1) * left-most recursive call is not allowed. ex. (? a|\gb) => error (? a|b\gc) => OK * Call by group number is forbidden if named group is defined in the pattern and ONIG_OPTION_CAPTURE_GROUP is not setted. * If the option status of called group is different from calling position then the group’s option is effective. ex. (?-i:\g )(?i:(?a)){0} match to “A” 10. Captured group Behavior of the no-named group (…) changes with the following conditions. (But named group is not changed.) case 1. /…/ (named group is not used, no option) (…) is treated as a captured group. case 2. /…/g (named group is not used, ‘g’ option) (…) is treated as a no-captured group (?:…). case 3. /..(? ..)../ (named group is used, no option) (…) is treated as a no-captured group (?:…). numbered-backref/call is not allowed. case 4. /..(? ..)../G (named group is used, ‘G’ option) (…) is treated as a captured group. numbered-backref/call is allowed. where g: ONIG_OPTION_DONT_CAPTURE_GROUP G: ONIG_OPTION_CAPTURE_GROUP (‘g’ and ‘G’ options are argued in ruby-dev ML) —————————– A-1. Syntax depend options + ONIG_SYNTAX_RUBY (?m): dot(.) match newline + ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA (?s): dot(.) match newline (?m): ^ match after newline, $ match before newline A-2. Original extensions + hexadecimal digit char type \h, \H + named group (? …) + named backref \k + subexp call \g , \g A-3. Lacked features compare with perl 5.8.0 + \N{name} + \l,\u,\L,\U, \X, \C + (?{code}) + (??{code}) + (?(condition)yes-pat|no-pat) * \Q…\E This is effective on ONIG_SYNTAX_PERL and ONIG_SYNTAX_JAVA. A-4. Differences with Japanized GNU regex(version 0.12) of Ruby 1.8 + add character property (\p{property}, \P{property}) + add hexadecimal digit char type (\h, \H) + add look-behind (?>]/ in EUC-JP encoding. + effect range of isolated option is to next ‘)’. ex. (?:(?i)a|b) is interpreted as (?:(?i:a|b)), not (?:(?i:a)|b). + isolated option is not transparent to previous pattern. ex. a(?i)* is a syntax error pattern. + allowed incompleted left brace as an usual string. ex. /{/, /({)/, /a{2,3/ etc… + negative POSIX bracket [:^xxxx:] is supported. + POSIX bracket [:ascii:] is added. + repeat of look-ahead is not allowed. ex. /(?=a)*/, /(?!b){5}/ + Ignore case option is effective to numbered character. ex. /\x61/i =~ “A” + In the range quantifier, the number of the minimum is omissible. /a{,n}/ == /a{0,n}/ The simultanious abbreviation of the number of times of the minimum and the maximum is not allowed. (/a{,}/) + /a{n}?/ is not a non-greedy operator. /a{n}?/ == /(?:a{n})?/ + invalid back reference is checked and cause error. /\1/, /(a)\2/ + Zero-length match in infinite repeat stops the repeat, then changes of the capture group status are checked as stop condition. /(?:()|())*\1\2/ =~ “” /(?:\1a|())*/ =~ “a” A-5. Disabled functions by default syntax + capture history (?@…) and (?@ …) ex. /(?@a)*/.match(“aaa”) ==> [, , ] see sample/listcap.c file. A-6. Problems + Invalid encoding byte sequence is not checked in UTF-8. * Invalid first byte is treated as a character. /./u =~ “\xa3” * Incomplete byte sequence is not checked. /\w+/ =~ “a\xf3\x8ec” // END

The Home We Carry

The text below are my speaking notes for a talk I gave before the Catholic Daughters League. It looks a bit odd because I occasionally write my speaking notes to look a bit more like poetry, to help me remember how I want things to sound in addition to what I want to say. It is something I learned from Henry Glassie.

It is, I think I can safely say, obvious to all of you here that women make much in our world. 

They make meals. 
    They make babies. 
        They make homes. 

In doing all of those things, 

in putting us on this earth, 
    in putting food in us, 
        in putting up with us, 

        they, most importantly of all, make us.

Despite the obviousness of all of this, 
attention to the women and the homes they make has been a long time coming. 

Those of us who study things like local cultures 
    have too long focused on men's folk culture, 
        mostly because men's culture tends to take place in public 
            and thus is readily available to outsiders 
                and its value seems obvious to insiders.

But men account for only half of who any group of people are. 
That seems obvious, right? 

And men are often put in charge of the least valuable parts of a culture: 
cars, lawns, barbecues. 

The most important part of any culture is its children: 
they are what keep it alive.

Now, we are lucky to live in a culture where men and women can be involved in raising children, 
but women have been, 
if we are to be honest, 
largely charged with the responsibility. 

And it's in our mother's arms 
that we first sway to the rhythms of life 
    that we will take with us out of the house 
        and with which we will make our own lives, 
                        our own homes. 

It is in our mothers' and fathers' voices that we learn our first words 
and how to speak them. 

    Ché, not chere. 
        Go make groceries, not go to the grocery store.

We say home is where the heart is, 
but the heart is our heart, 
    and we take it with us wherever we go. 

    By giving us our hearts (both literally and figuratively), 
        women give us ourselves.

My point in all this is simple: home isn't inside a house. 
People aren't cooped up at home. 
    Home is the center of a family, 
        the center of our hearts. 

        From home, everything radiates outwards. 

Louisiana has been lucky in having sensitive recorders of its folk culture, men and women who cued us early on to the wealth that is women’s folk culture. While those historical recordings — most of which are available at the Archives of Cajun and Creole Folklore for all to hear — sent contemporary folklorists to seek out the kinds of ballads and stories that really are the commonwealth of a culture, it also began a discussion about the larger role women play.

Kristi Guillory set off at the start of this decade to document, quite literally, old wives’ tales: she interviewed older women about bearing and rearing children. Her work here is almost revolutionary for the academy but obvious to those of us living our lives: can anyone doubt that our fundamental feeling for the world and how to live in it is established in those formative years when our mothers, and our fathers, pad our bottoms either to dry them or pad them to set us straight?

Her later work was to examine the images and ideas found in Cajun music, and in her thesis she collected and analyzed the lyrics of over 200 songs from our part of the world.

She is joined tonight by Yvette Landry and Chris Segura.

Yvette Landry is a Breaux Bridge native and, perhaps most importantly of all, a former Crawfish Queen. More seriously, Yvette plays bass guitar with the Lafayette Rhythm Devils and Bonsoir Catin. By night she is a fine musician, from a long line of musicians; by day, she is a teacher at the Episcopal School of Acadiana.

Chris Segura has been playing fiddle since the age of four and is a member of Feufollet and the Lafayette Rhythm Devils. While Chris is currently a UL student, he also owns, along with his friend and colleague, Chris Stafford a successful recording studio where they recently produced the popular Allons Boire Un Coup project with Valcour Records.`

Tornado of Tidiness

The transition to her new day care is still not complete — in the sense that she still cries, if only a little these days, when we drop her off — but already the place is beginning to have an impact on the Bean.

For instance, we ended up running a little late getting out of the house to do yesterday’s lessons because Lily insisted on taking the time to put her toys away once she was done playing with them. (It’s a very odd thing to find yourself as a parent actually getting a little impatient with your child being tidy.) And the tidiness is widespread: all her toys get returned to their proper bin and the bin gets carried back to the its shelf. This morning, when we had finished putting them away, she actually uttered a little “Yes!”

And she just doesn’t say no now. Instead, it’s “No thank you, no thank you, no thank you” when she is refusing something.

She has also started to say small prayers during her play meals. (Curiously, this doesn’t come up during our actual meals.) We’re not too sure what to make, or how to feel, about this last thing, but we’re willing to let it ride for the time being.

The Bean has been sick this weekend, with a little head cold, but Yung swore last weekend that she already detected a certain amount of boredom in the Bean. Perhaps, Yung suggested, she has already gotten used to a certain amount of activity and stimulation at school.

We are certainly actively engaging her more now. For one, we miss her while she is at her school and so we look forward to spending time with her. For another, we have both decided that too much of work has crept into our home life. We both feel the need for more distinction. We both love what we do as intellectuals, but both of us feel that our institution is all too glad to consume as much of us as it can, and that just wasn’t good for us. (And with “us” now including Lily, it’s easier to see and feel.)

Not Man of the Year

I was delighted to be asked to help raise money for the Leukemia-Lymphona Society. A great bunch of people, most especially Leslie Schilling. Who is the greatest of the great.

Lily’s Nightmares

It has been two years now since we brought Lily home, and right from the beginning I hated every time she cried out in her sleep. At first, her night-time cries were simply physical distress. Later, when she hit that moment in her development when she had night tremors, I comforted myself with the fact, as doctors re-assured me, that she wasn’t really dreaming, but we now that she can talk, we can no longer pretend that she isn’t having nightmares.

Last week, the night after we returned from our grand trip to Houston, she woke up crying “truck blown away, truck blown away!” (We had seen a pretty terrible wreck on the interstate, one in which one of the vehicles, a six-wheeled panel truck, was on fire, sending up huge plumes of smoke in the misty rain of the day. We had, however, said nothing about what had happened, no mention of blowing up or away.)

Later in the week, she woke up screaming “my blanket, my blanket. It’s my blanket!” We both rushed to her and all of us ended up sleeping in her bed.

And this morning she woke up crying “go home! go home!”

Lily Reads

You read that right, or, rather, er, okay, not really. But let me explain: tonight, as I sat with Lily on my lap, after she had finished her first bottle, we read one of her three Charlie and Lola books, aka “CharlieLola.” And then she got out another one — which she does by leaning wayyy out over the arm of the chair and dangling her arms into the basket of books which she calls “library” all the while saying “let’s see, let’s see.”

Wouldn’t you know it, but out comes another “CharlieLola” book. Her first one, the one about books and libraries. At first she just sits on my lap flipping through it, talking a bit about books and “CharlieLola.” And then she starts to read the book, or rather, she has heard the book so many times that she knows how it begins:

I have this little sister. Her name is Lola.
She is small and very funny.

From there she went on to describe much of the plot of the book. By this point, Yung-Hsing had joined me in the bedroom and we both simply sat there with our jaws in our laps, listening to Lily read to us while she turned the pages.

Lily at 2

Lily turned two last Wednesday, and, well, we never did get around to hosting a party — neither of us are party planners — but we did manage to host a birthday weekend in Houston for the Bean. While we did not set out to make shopping for her a major component of the trip, I have to admit that most of the bags in the back of the car were for her. I got a computer game — which I can’t play on my current computer, and Yung-Hsing got a few clothes. Lily got a table, a chair, a stool, a hanging set of shelves, some huge leaves to make a canopy for her bed, some books, and I don’t even know what else.

Today Lily went to the doctor for her two-year checkup. The results are in:

ITEM The Bean Percentile
Height 33.5in 45%
Weight 24lbs 12oz     30%
Head Circumference     18.5in 35%

In sum, she is holding her course: staying just about dead average for height, light on weight, and a smallish head.

Page 21 of 24

© John Laudun