Link 2 Nov 23 notes Adding Sass to Sublime Text2»
Photo 12 Oct 13 notes RIP Dennis Ritchie, Creator Of Unix And C Dies

RIP Dennis Ritchie, Creator Of Unix And C Dies

Text 28 Sep 258 notes Getting a valid list of urls in a Symfony2 project

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!.

Text 28 Sep 296 notes Rake with Rails 3.1rc1

Do you have an error executing a rake task using the new rails version?: Just do the following:

bundle exec rake
And 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.

Text 15 Sep 23 notes How to search files with less common extensions with AckMate

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 ~/.ackrc
and add these lines:
--type-add
php=twig
And you got it!. P.S.: Other examples:
--type-set=sass=.scss
--type-set=coffee=.coffee

Text 17 Aug 4 notes Learning by accident. Chapter #2134

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.

Link 10 Aug 9 notes A "must" for MacOSX and terminal users »

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…

Text 9 Aug 5 notes SASS Bundle for TextMate

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'

Text 8 Aug 3 notes Installing postgres with Brew in MacOSX

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.plist
If you need a gem for posgres do:
env ARCHFLAGS="-arch x86_64" gem install pg
Install Instrumentation, in my case (postgres version 9.0.4):
psql -d postgres < /usr/local/Cellar/postgresql/9.0.4/share/postgresql/contrib/adminpack.sql
At this moment, you installed postgress (it’s only a note). Ok, let’s create a new role:
psql -d postgres
With this command, you’ll see all roles created:
postgres-# \du
We 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.

Text 1 Aug 53 notes jQuery can’t get some properties from a hidden element

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.


Design crafted by Prashanth Kamalakanthan. Powered by Tumblr.