Skip to content

Instantly share code, notes, and snippets.

@antonsamper
antonsamper / environment.config
Last active October 11, 2016 10:52
AWS Elastic Beanstalk environment extensions for Node.js Web Server Applications
container_commands:
01_node_binary:
command: "ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/node /bin/node"
02_npm_binary:
command: "ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/npm /bin/npm"
03_pm2_install:
command: "if [ ! -e /bin/pm2 ]; then npm install pm2 -g; fi"
04_pm2_binary:
command: "ln -sf `ls -td /opt/elasticbeanstalk/node-install/node-* | head -1`/bin/pm2 /bin/pm2"
05_node_log:
@antonsamper
antonsamper / gist:16a7f3120296b51436e5c5e80c877cd0
Last active October 11, 2016 07:59
AWS EC2 Log Symlinks for Node.js Web Server Applications
ln -s /var/log/nodejs/nodejs.log nodejs.log
ln -s /var/log/nginx/error.log nginx-error.log
ln -s /var/log/nginx/access.log nginx-access.log
ln -s /var/log/eb-activity.log eb-activity.log
ln -s /var/log/eb-commandprocessor.log eb-commandprocessor.log
angular.module('myMdl', []).config(['$httpProvider', function($httpProvider) {
$httpProvider.responseInterceptors.push([
'$q', '$templateCache', 'activeProfile',
function($q, $templateCache, activeProfile) {
// Keep track which HTML templates have already been modified.
var modifiedTemplates = {};
// Tests if there are any keep/omit attributes.
var HAS_FLAGS_EXP = /data-(keep|omit)/;
@antonsamper
antonsamper / angularjs-resource-cache-not-working
Created November 18, 2013 18:10
AngularJS $resource not caching
myApp.factory('myData', function ($resource) {
return $resource('http://example.com/api/events', {}, {
'options': {
'cache': true
}
});
});