In my case, I wanted to get a complete list of valid urls to use Helium-css (to clean all the unused css of the project) and to take the advantage of the routing, I executed this command (you should replace BASE_URL to your base_url:
app/console router:debug | awk '{print "BASE_URL"$3}'
With this, you only have to paste the list to the helium window (replacing some id…) and you got it!.
Do you have an error executing a rake task using the new rails version?: Just do the following:
bundle exec rakeAnd if you don’t want remember this command each time, you could make an alias:
alias rake="bundle exec rake"Or even add it to your bash profile, ;) Why do you have the error?. The new version of rails breaks a few of things and you should use the version 0.8.7 of this rake gem instead of any other.
In my case is .twig but you can do it for any extension. It’s simple and you can check it in wiki ack’s page but if you’re not too acquainted with these kind of things, just do the following:
mate ~/.ackrcand add these lines:
--type-add php=twigAnd you got it!. P.S.: Other examples:
--type-set=sass=.scss --type-set=coffee=.coffee
Playing with Firebug console, if you edit a number value you can do:
With arrows (↑/↓) increments are 1[+/-].
So far I knew this… but if you press at same time ⌘ the variations will be 0.1[+/-] or if the key pressed is ⇧ will be 10.
It’s a stupid thing but I didn’t know it and it useful for me. I hope you too.
This app is wonderful. You can split your terminal window (so many times you want) and to get a full control for everything you do.
CMD+D (split vertically)
Shift+CMD+D (split horizontally)
CMD+Tab (like default terminal app in MacOSX - create a new tab).
etc, etc…
mkdir -p ~/Library/Application\ Support/TextMate/Bundles
cd ~/Library/Application\ Support/TextMate/Bundles
git clone git://github.com/charlesr/ruby-sass-tmbundle.git "Ruby Sass.tmbundle"
osascript -e 'tell app "TextMate" to reload bundles'
Homebrew is wonderful but sometimes it can be a little headache. For example, if you’ve created a rake task with ruby that assume a role called postgres (by default), probably if you installed with brew you won’t have it. Brew get your system user and unless your name would be postgres, you have to create it. For this reason, I’m going to write the easy steps to create a new role with admin privileges. Remembering, you did:
brew install postres
initdb /usr/local/var/postgres
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plistIf you need a gem for posgres do:
env ARCHFLAGS="-arch x86_64" gem install pgInstall Instrumentation, in my case (postgres version 9.0.4):
psql -d postgres < /usr/local/Cellar/postgresql/9.0.4/share/postgresql/contrib/adminpack.sqlAt this moment, you installed postgress (it’s only a note). Ok, let’s create a new role:
psql -d postgresWith this command, you’ll see all roles created:
postgres-# \duWe create a new user called postgres like this way:
postgres=# CREATE ROLE postgres SUPERUSER CREATEDB CREATEROLE LOGIN;And that’s all. If you list all users again you’ll see that a new user has been created.
Today I founded an error with a plugin called Stylish Select (for customized selects). My select was contained in a hidden content (for filtering searches) and the plugin didn’t customize correctly my combo element. Its height was 0. And what’s the problem?, all its calculated operations are wrong. What’s the solution?, simply. Just find that hidden element (respect a concrete element):
var elToShow = $(this).parents(":hidden:last");
And show it:
if (elToShow.html() != null && elToShow.html().trim()){ // not empty
var hideElement = 1;
elToShow.show();
}
Calculate all its dimensions and immediately, hide it again:
if (hideElement) elToShow.hide();And that’s all. P.S.: I forked my own version of that plugin. You can download it, here.
