Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
Get Homebrew installed on your mac if you don't already have it
Install highlight. "brew install highlight". (This brings down Lua and Boost as well)
| # | |
| # Run as root | |
| # $ bash <(curl -s https://raw.github.com/gist/1631411) | |
| # | |
| # Update, upgrade and install development tools: | |
| apt-get update | |
| apt-get -y upgrade | |
| apt-get -y install build-essential git-core curl \ | |
| libssl-dev \ |
| <script> | |
| angular.directive('tj:focus', function(){ | |
| return function(scope, element){ | |
| element[0].focus(); | |
| }; | |
| }); | |
| </script> | |
| <div> | |
| <input type="text" ng:model="model" tj:focus /> |
Authored by Peter Rybin , Chrome DevTools team
In this short guide we'll review some new Chrome DevTools features for "function scope" and "internal properties" by exploring some base JavaScript language concepts.
Let's start with closures – one of the most famous things in JS. A closure is a function, that uses variables from outside. See an example:
| #!/usr/bin/env node | |
| var https = require('https'); | |
| var options = { | |
| hostname: 'www.toggl.com', | |
| path: '/api/v6/time_entries.json', | |
| headers: { | |
| 'Content-Type': 'application/json' | |
| }, | |
| auth: "YOUR_API_TOKEN:api_token" | |
| }; |
| Look at the README. |
| @mixin same($values...) { | |
| $length: length($values); | |
| $value: nth($values, $length); | |
| @for $i from 1 to $length { | |
| #{nth($values, $i)}: $value; | |
| } | |
| } | |
| // Usage: |
| @mixin same($values...){ | |
| $length: length($values); | |
| $value: nth($values, $length); | |
| @for $i from 1 to $length{ | |
| #{nth($values, $i)}: $value; | |
| } | |
| } | |
| //Usage: |