Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
Install Python
$ brew install readline sqlite gdbm
$ brew install python --universal --framework
$ python --version
Python 2.7
Symlinks...
| Backbone.Collection.prototype.update = function(collection) { | |
| var _ids = _(collection) | |
| .chain() | |
| .reduce(function(ids, model) { | |
| var | |
| id = model.id | |
| ,needle = this.get(id) | |
| ; | |
| if (needle) { |
| # Note that while this file is in our config folder, it is | |
| # symlinked to our site folders, so paths are relative from there | |
| # Require gems and Compass plugins | |
| # require 'rgbapng' | |
| # require 'compass-fancybox-plugin' | |
| require 'compass-growl' | |
| # General | |
| output_style = :expanded |
This will enable Sass+Compass with LiveReload through Guard. (Guard screen cast)
You will also need a browser component to communicate with LiveReload. (browser extension, livereload.js)
If you prefer going through a GUI, that option is available. The following instructions is specific to Mac OS X and it works through the command line.
Note that this is not specific to Rails projects. This can work for any standalone front-end project.
| import os | |
| from django import template | |
| from django.utils import version | |
| from settings import PROJECT_PATH | |
| STATIC_PATH = os.path.join(PROJECT_PATH, '../static') | |
| register = template.Library() | |
| @register.simple_tag | |
| def revision_number(): |
| $sprites: sprite-map("sprites/*.png"); | |
| $sprites-retina: sprite-map("sprites-retina/*.png"); | |
| @mixin sprite-background($name) { | |
| background-image: sprite-url($sprites); | |
| background-position: sprite-position($sprites, $name); | |
| background-repeat: no-repeat; | |
| display: block; | |
| height: image-height(sprite-file($sprites, $name)); | |
| width: image-width(sprite-file($sprites, $name)); |
| #!/usr/bin/env ruby | |
| # Requires imagesnap from https://github.com/alexwilliamsca/imagesnap (brew install imagesnap) | |
| # To assemble the video use http://www.dayofthenewdan.com/projects/tlassemble | |
| file="~/.gitshots/#{Time.now.to_i}.jpg" | |
| puts "Taking capture into #{file}!" | |
| system "imagesnap -q -w 3 #{file}" | |
| exit 0 |
Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.
For the sake of this example, let’s pretend the subfolder containing your site is named dist.
Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).
| /* | |
| No jQuery necessary. | |
| Thanks to Dan's StackOverflow answer for this: | |
| http://stackoverflow.com/questions/123999/how-to-tell-if-a-dom-element-is-visible-in-the-current-viewport | |
| */ | |
| function isElementInViewport(el) { | |
| var rect = el.getBoundingClientRect(); | |
| return ( | |
| rect.top >= 0 && |
Isso é util para garantir que a sua aplicação funcione sem problemas no futuro ou por exemplo se você tem projetos usando diferêntes versões do Sass ou Compass.
É necessário instalar o bundler (http://bundler.io/)
$ gem install bundler