Tagging a git release with current branch name and date

Either add this to your .git/config

[alias]
datetag = !git tag `git name-rev --name-only HEAD`-`date \"+%Y%m%d%H%M\"`

or run it in your project folder to add it to the config for that project:

git config alias.datetag '!git tag `git name-rev --name-only HEAD`-`date "+%Y%m%d%H%M"`'

Then you can just run 'git datetag' to create a new tag to use as a release

Loading mentions Retweet
Filed under  //   deployment   git   hosting   tech  

Comments [0]

Setting RAILS_ENV on Dreamhost when running Passenger

It may depend on which server you are on, but mine has mod_env
enabled, so it's a simple matter of setting the ENV['RAILS_ROOT'] in
an .htacess file
 
SetEnv RAILS_ENV staging
Loading mentions Retweet
Filed under  //   dreamhost   hosting   rubyonrails   tech  

Comments [0]

http://g.raphaeljs.com/

A sweet javascript charting/graphing library. Soon there may be no
need for flash/flex every again?
Loading mentions Retweet
Filed under  //   charting   javascript   tech  

Comments [0]

Avoiding some of the negative trade-offs in the template pattern with ruby's dynamicism?

So my buddy Tammer's recent post about the Gang of Four's Template Pattern reminded me of some code I saw recently. A start-up's greenfield project had it's authorization done in a pretty clean way using the template pattern. Basically every object determined what could be done to it, something like this:

After continuing this approach to fully cover CRUD you make a straight-forward set of accessors that can be used to easily enforce permissions in the controller in a programmatic way (this project was using on of the inherited resourceful-controller plugins, so that was a big plus). The developer who implemented this commented that the trade-off for this simplicity was having to look in each individual model file to figure out what a user can do overall.

I figured I liked everything about this scheme except that trade-off, and since ruby is so dynamic, why settle for almost. Why not just reopen each class in the authorization file and add the methods. You still get the simplicity and encapsulation of having the model able to determine it's own permissions, based on it's state and methods, and there is still one place to look to review/change the permissions for the whole project:

Thoughts?

Loading mentions Retweet
Filed under  //   ruby   rubyonrails   tech  

Comments [2]

Maus hanging out in bed

Loading mentions Retweet

Comments [0]

So after trying both I like posterous better than tumblr

It just seems easier to use and they seem to be making more
improvements, while tumblr seems sort of stalled. Since it's so easy
to post to multiple services with posterous I'll just keep my tumblr
around as a back-up, but I'm redirecting the feedburner feed to here
instead. I'm sorry if this causes duplicate entries in feedburner,
but this is the last time I swear.

The ability to have tumblr auto-import from various services was a
nice feature. But I've decided I'll just do it in the reverse order -
only post things to posterous worth saving to my blog, and then have
that autopost to flickr/etc. If I really decide I want to auto-splice
in other rss feeds (like say my Google Reader Shared/Starred items) I
could always set-up a Yahoo Pipe to mix this rss with others before
passing it into Feedburner. I still think Feedburner should allow
splicing of arbitrary feeds.

Loading mentions Retweet
Filed under  //   blogging  

Comments [0]

My Favorite bash Tips and Tricks

which produces the same result. However, brace expansion becomes quite useful when the brace-enclosed list occurs immediately before, after or inside another string:

$ echo {one,two,red,blue}fish
onefish twofish redfish bluefish

$ echo fish{one,two,red,blue}
fishone fishtwo fishred fishblue

$ echo fi{one,two,red,blue}sh
fionesh fitwosh firedsh fibluesh

Notice that there are no spaces inside the brackets or between the brackets and the adjoining strings. If you include spaces, it breaks things:

$ echo {one, two, red, blue }fish
{one, two, red, blue }fish

$ echo "{one,two,red,blue} fish"
{one,two,red,blue} fish

However, you can use spaces if they're enclosed in quotes outside the braces or within an item in the comma-separated list:

$ echo {"one ","two ","red ","blue "}fish
one fish two fish red fish blue fish

$ echo {one,two,red,blue}" fish"
one fish two fish red fish blue fish

You also can nest braces, but you must use some caution here too:

$ echo {{1,2,3},1,2,3}
1 2 3 1 2 3

$ echo {{1,2,3}1,2,3}
11 21 31 2 3

Now, after all these examples, you might be thinking to yourself, “Gee, those are great parlor tricks, but why should I care about brace expansion?”

Brace expansion becomes useful when you need to make a backup of a file. This is why it's my favorite shell trick. I use it almost every day when I need to make a backup of a config file before changing it. For example, if I'm making a change to my Apache configuration, I can do the following and save some typing:

$ cp /etc/httpd/conf/httpd.conf{,.bak}

Notice that there is no character between the opening brace and the first comma. It's perfectly acceptable to do this and is useful when adding characters to an existing filename or when one argument is a substring of the other. Then, if I need to see what changes I made later in the day, I use the diff command and reverse the order of the strings inside the braces:

$ diff /etc/httpd/conf/httpd.conf{.bak,}
1050a1051
> # I added this comment earlier

Brace expansion is pretty cool when used as pseudo-globbing.

Loading mentions Retweet
Filed under  //   bash   tech   unix  

Comments [2]

SSD degradation due to software development usage - via @brynary

http://macperformanceguide.com/Storage-SSD-Reconditioning.html

"Six months of experience with the Intel X25-M solid state drive (SSD)
on the Mac Pro revealed the severe degradation of write speed to
roughly 1/4 of the original speed, with unpredictable pauses. This
behavior was induced by intense usage of the SSD for software
development, an inappropriate use for an SSD, because over time it
involves the creation and deletion of untold millions of small files."

Loading mentions Retweet
Filed under  //   apple   tech  

Comments [0]

Loading mentions Retweet
Filed under  //   photo  

Comments [0]

interesting new ruby, redis-based background job/queueing choice from the github guys

http://github.com/blog/543-new-resque-web-ui
http://github.com/defunkt/resque

Yet another queuing system, but I do like the look of the included
Sinatra mini-app for managing it. And isn't redis all the hot thing
now? Or is that a negative?

Loading mentions Retweet
Filed under  //   ruby   tech  

Comments [0]

About

http://oldblog.timocracy.com
gmail github