May 2012
2 posts
4 tags
Tell someone
Work remotely sometimes could be annoying, especially when you have a trouble with something and you can’t share it quickly.
This works to me:
1. Record a screencast (I use http://www.techsmith.com/jing.html) and explain your problem to “another person”.
2. Watch the screencast. If you explained your problem wrong, repeat the step 1!!
The 98% of cases I just found a...
robotmay: Everyone should be using low level... →
robotmay:
Low level caching is very easy to get started with in Rails 3, but it seems to be missing from the official guides. I personally use it all the time to help reduce the number of queries or API calls I’m making. Heroku has a pretty good explanation which, if you’re so far unfamiliar with…
April 2012
4 posts
7 tags
Use SublimeText from command line
Create a symbolic link doing:
$ ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl
Run subl --help
As a creative person, you’ve been given the ability to build things from nothing...
– Ben Pieratt (via declarationofprocess)
3 tags
Create a hash from an array with Hash[*arr]
rubyquicktips:
The Hash::[] class method can be used in addition to the splat operator to create a hash from an array.
arr = [:a, 1, :b, 2]
Hash[*arr]
# => {:a => 1, :b => 2}
3 tags
March 2012
3 posts
5 tags
4 tags
5 tags
Good caching tutorial →
February 2012
2 posts
Testing fadeOut event with Jasmine →
January 2012
1 post
December 2011
1 post
November 2011
8 posts
7 tags
My forked version of wysiwyg editor created by... →
Thanks to creators of this completely library agnostic wysiwyg: (No jQuery, Prototype or similar is required):
@tiff @ingochao @uwe
3 tags
blat:
Javier Santana - Cómo montar tu empresa desde cero
5 tags
Using Sass with sprites
It’s very simple and powerful. Look at this:
Imagine that your single element’s height is 38px; Ok, you can define a variable with this:
$height-element:58px;
Ok, and now you have your background sprite:
.element {
position:absolute;
bottom:0;
right:0;
width:94px;
background:url(sprite.png) no-repeat 0 0;
height:$height-element;
...
7 tags
Build a powerful Flickr Gallery with Rails and js
If you are using Rails and you need a flickr gallery just bear in mind these two things:
- Flickraw gem
- Galleria plugin
With the first one you need just to add it to your site:
FlickRaw.api_key = 'YOUR_API_KEY'
FlickRaw.shared_secret = 'YOUR_FLICKR_SECRET'
flickr = FlickRaw::Flickr.new
And using the complete flickr api, you can use, for example:
@photo_sets =...
3 tags
Setting remotes/origin/HEAD to origin/master
Probably you want to track a new branch locally based on a remote. Just something like:
git branch --track <new-branch> <remote-branch>
Be careful because if you’has selected a remote branch like HEAD, probably you lost the link to master branch. If you want to restart this, you should type:
git remote set-head origin master
8 tags
Updating ImageMagick with Brew and MacOSX Lion
Upgrade to MacOSX Lion is not perfect. And ImageMagick is not an exception. First of all (obvious), don’t forget to install XCode (or reinstall the C compiler).
Following, probably you have tried to download it the binary source but I prefer still using HomeBrew to these kind of things. To do it with this method, just type the next:
cd /usr/local
git reset --hard FETCH_HEAD
brew install...
5 tags
How to add Zen Coding to Sublime Text 2
Just type:
$ hg clone https://bitbucket.org/sublimator/sublime-2-zencoding ZenCoding
and reload SublimeText 2!
P.S.: If you don’t have mercurial (hq) installed, you can do it so:
$ easy_install pip && pip install Mercurial
3 tags
Adding Sass to Sublime Text2 →
October 2011
1 post
5 tags
September 2011
3 posts
4 tags
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!.
5 tags
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...
8 tags
How to search files with less common extensions...
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
August 2011
6 posts
4 tags
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.
4 tags
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…
4 tags
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'
4 tags
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...
6 tags
jQuery can't get some properties from a hidden...
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...
5 tags
Bookmarklet for dragging rows
In my job, we’re using a boring tool to distribute tasks.
I miss one option to organise my tasks in a specific order (like basecamp, for example). Not to wait for a drupal developer (with admin perms) I’ve added a simple bookmarklet to do this.
Do you want to try it? (it works for all tables of your current page).
Just drag the following bookmarklet to your bookmarks bar.
Drag...
July 2011
6 posts
6 tags
Select customized with jQuery →
This is my forked version of this plugin. Allows multi-select and single options.
7 tags
Ryan Singer at Future of Web Apps, London 2010 →
6 tags
I'm a Dribble player →
Thanks to Maximilian Schoening for invite me!
4 tags
What is added installing MySQL on MacOSX with...
It was just simple curiosity. I tried to remove all mysql contains from my computer and I ran:
brew install mysql
I wonder, what’s whole stuff is installed. Listing with:
find / -name mysql -print 2> /dev/null
And is the...
5 tags
Installing php + phing in MacOsX with Brew
How to install PHP with Brew
Grab the latest copy of my PHP brew and copy it into your Homebrew Formula directory. The formula isn’t added by default.
curl -O https://github.com/ampt/homebrew/raw/php/Library/Formula/php.rb
mv php.rb `brew --prefix`/Library/Formula
Install php with brew
brew install php --with-apache --with-mysql
The default location of mysql.sock is in the...
June 2011
10 posts
6 tags
In rvm we trust
If some time you have wrote that you don’t trust in rvm (in a project configuration process I mean):
================================================================
= Trusting an .rvmrc file means that whenever you cd into the =
= directory RVM will execute this .rvmrc script in your shell =
= =
= Now that you have...
6 tags
Bank holidays in whole world →
API for getting data about holidays
6 tags
To get params url with Javascript
If you want to get the real params (not actual url) you don’t have to pass it to the function.
function getValue(varname,url)
{
// First, we load the URL into a variable
if (url == undefined) var url = window.location.href;
// Next, split the url by the ?
var qparts = url.split("?");
// Check that there is a querystring, return "" if not
if (qparts.length == 0)
{
...
5 tags
Vanessa Viaji web →
I designed and developed this web 2 months ago and I forgot to public the url. I hope you like it! (sorry for inconvenience, is in spanish). It’s made of in Ruby on Rails and deployed in Heroku.
4 tags
How to fix cross domain problem with font-face and... →
Firefox requires that all font assets be served from the same domain. Lastly it is possible that you need to add WOFF to your list of MIME types (if you are serving via IIS.)
5 tags
My favourites TextMate PlugIns
To write less
- ZenCoding
To search faster
- Ack
To browse better in proyect
- ProjectPlus
Jasmine snippets provided
- Jasmine Bundle
Sass
- Sass Bundle
—-
If you have any other, please, share it!
4 tags
5 tags
Background gradient + Background image with CSS3
If we want to make a button (for example) with background gradient plus a concrete image we can do the following:
.blue-button {float:left; text-align:center; padding:6px 38px 6px 15px;border:1px solid #A9C5D6; color:white; font:bold 14px Arial; height:18px; text-decoration:none; margin-
/* text shadow */
text-shadow:1px 1px 0px #6397B1;
/* border*/
-webkit-border-radius: 7px;
...
3 tags
sudo /usr/sbin/apachectl restart
– Apache restart
4 tags
Showing git branches in your prompt
It’s simply. You only have to add the following in your /etc/bashrc
# You should have already defined the PS1 variable. You should update it
function parse_git_branch_and_add_brackets {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\ \[\1\]/'
}
PS1="\h:\W \u\[\033[0;33m\]\$(parse_git_branch_and_add_brackets) \[\033[0m\]\$ "
Reset terminal and you got it!
...
May 2011
1 post
4 tags
April 2011
4 posts
6 tags
Do you want to write less?
5 tags