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;
}
And for example 4 elements using this sprite (adding another class):
Inside your .element class:
&.kind-one {
background-position:0 0;
}
&.kind-two {
background-position:0 #{-($height-element)};
}
&.kind-three {
background-position:0 #{-($height-element*2)};
}
&.kind-four {
background-position:0 #{-($height-element*3)};
}
And if you want to add a new element to the sprite or if one of the elements is changed it’s very simple to be used!
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 = flickr.photosets.getList(:user_id => "USER_ID")And with Galleria, you could get everything that you want: Ruby code:
<div id="gallery">
<% @photo_sets.each do |set| %>
<div id="<%= set.id %>" class="photo_set"></div>
<% end %>
</div>
Javascript code:
// if you have severals, you can do it with an each loop
var set_id = $('#gallery').children('.photo_set').attr('id');
$('#gallery').children('.photo_set').galleria({
flickr: 'set:'+set_id,
flickrOptions: {
sort: 'date-posted-asc'
}
});
P.S.: I wrote a simple example, starting here you can everything that you can imagine, ;)
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
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 imagemagickThat’s all
Just type:
$ hg clone https://bitbucket.org/sublimator/sublime-2-zencoding ZenCodingand reload SublimeText 2! P.S.: If you don’t have mercurial (hq) installed, you can do it so:
$ easy_install pip && pip install Mercurial

