Tested in Mac OS X: super == command
Open/Goto
- super+t: go to file
- super+ctrl+p: go to project
- super+r: go to methods
| $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)); |
| --- | |
| - name: install rb-installer | |
| action: shell curl https://raw.github.com/fesplugas/rbenv-installer/master/bin/rbenv-installer | bash | |
| - name: update PATH in ~/.bash_profile for rb-env | |
| action: lineinfile dest=/home/$user/.bash_profile line=export\ PATH="$HOME/.rbenv/bin:$PATH" regexp=PATH.*rbenv | |
| - name: add rb-env init to ~/.bash_profile | |
| action: lineinfile dest=/home/$user/.bash_profile line='eval "$(rbenv init -)"' regexp=eval.*rbenv | |
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).
Prerequisites:
Software components used:
| // strip-units required by spread mixin | |
| // http://stackoverflow.com/questions/12328259/how-do-you-strip-the-unit-from-any-number-in-sass | |
| @function strip-units($number) | |
| @return $number / ($number * 0 + 1) | |
| // pow and sqrt required by ease function | |
| // adapted from https://github.com/at-import/Sassy-math/blob/master/sass/math.scss | |
| @function pow($base, $exponent) | |
| $value: $base |
2015-01-29 Unofficial Relay FAQ
Compilation of questions and answers about Relay from React.js Conf.
Disclaimer: I work on Relay at Facebook. Relay is a complex system on which we're iterating aggressively. I'll do my best here to provide accurate, useful answers, but the details are subject to change. I may also be wrong. Feedback and additional questions are welcome.
Relay is a new framework from Facebook that provides data-fetching functionality for React applications. It was announced at React.js Conf (January 2015).
| # You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
| # This is how I upload my new Sol Trader builds (http://soltrader.net) | |
| # Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
| S3KEY="my aws key" | |
| S3SECRET="my aws secret" # pass these in | |
| function putS3 | |
| { | |
| path=$1 |
| #!/bin/sh | |
| # Run changed javascript files through jshint before commiting and prevent bad | |
| # code from being committed. | |
| # If you need to prevent newly added js from being checked because its in a | |
| # library like bower_components, add a .jshintignore file and list the directory | |
| # INSTALL: Add as a file in your repo as .git/hooks/pre-commit | |
| FILES=$(git diff --cached --name-only --diff-filter=ACM| grep ".js$") | |
| if [ "$FILES" = "" ]; then | |
| exit 0 |
| wait4eth1() { | |
| CNT=0 | |
| until ip a show eth1 | grep -q UP | |
| do | |
| [ $((CNT++)) -gt 60 ] && break || sleep 1 | |
| done | |
| sleep 1 | |
| } | |
| wait4eth1 |