This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 1. npm init | |
// 2. npm install --save webpack webpack-dev-server babel-loader babel-preset-es2015 | |
// 3. mkdir dist && touch index.html | |
// 4. Include `<script src="/bundle.js"></script>` inside index.html | |
// 5. mkdir src && touch src/index.js | |
// 6. Add some code to index.js (e.g. `console.log('Hello, World!')) | |
// 7. npm start | |
// 8. Browse to http://localhost:8080/dist/ | |
const webpack = require('webpack') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// it require either lodash or underscorejs | |
.config(function(RestangularProvider) { | |
// add a response interceptor | |
RestangularProvider.addResponseInterceptor(function(data, operation, what, url, response, deferred) { | |
extractedData = data.data; | |
extractedData.meta = data.meta; | |
extractedData.included = data.included; | |
function _apply(elem, fct){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the views folder: | |
views/ | |
- user/ | |
- edit.html.erb | |
- show.html.erb | |
- ... | |
Access a template here: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd $HOME | |
ln -s `which php54` ~/bin/php | |
export PATH=$HOME/bin:$PATH | |
curl -sS https://getcomposer.org/installer | php54 | |
echo -e "\n# Composer\nalias composer=\"php54 \$HOME/composer.phar\"" >> $HOME/.bash_profile | |
source $HOME/.bash_profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myApp = angular.module('myApp', []); | |
myApp.directive('googleplace', function() { | |
return { | |
require: 'ngModel', | |
link: function(scope, element, attrs, model) { | |
var options = { | |
types: [], | |
componentRestrictions: {} | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Syntax sugar | |
class ArrayValidator < EnumValidator | |
end |