Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
| # first: | |
| lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done | |
| sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.* | |
| # To recap, the best way (I've found) to completely uninstall node + npm is to do the following: | |
| # go to /usr/local/lib and delete any node and node_modules | |
| cd /usr/local/lib | |
| sudo rm -rf node* |
| /** | |
| * Module dependencies. | |
| */ | |
| var express = require('express') | |
| , routes = require('./routes') | |
| , user = require('./routes/user') | |
| , http = require('http') | |
| , path = require('path'); |
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
const Article = require('../../../../app/models/article');Those suck for maintenance and they're ugly.
| var Promise = require('bluebird'); | |
| var promiseWhile = function(condition, action) { | |
| var resolver = Promise.defer(); | |
| var loop = function() { | |
| if (!condition()) return resolver.resolve(); | |
| return Promise.cast(action()) | |
| .then(loop) | |
| .catch(resolver.reject); |
When using directives, you often need to pass parameters to the directive. This can be done in several ways. The first 3 can be used whether scope is true or false. This is still a WIP, so validate for yourself.
Raw Attribute Strings
<div my-directive="some string" another-param="another string"></div>A Dashing widget for displaying the number of visitors to your website over a specified timeframe, as reported by Google Analytics
| <!-- Raven.js Config --> | |
| <script src="{{ JS_PATH }}/lib/raven.js" type="text/javascript"></script> | |
| <script type="text/javascript"> | |
| // Ignore list based off: https://gist.github.com/1878283 | |
| var ravenOptions = { | |
| // Will cause a deprecation warning, but the demise of `ignoreErrors` is still under discussion. | |
| // See: https://github.com/getsentry/raven-js/issues/73 | |
| ignoreErrors: [ | |
| // Random plugins/extensions | |
| 'top.GLOBALS', |
I have always struggled with getting all the various share buttons from Facebook, Twitter, Google Plus, Pinterest, etc to align correctly and to not look like a tacky explosion of buttons. Seeing a number of sites rolling their own share buttons with counts, for example The Next Web I decided to look into the various APIs on how to simply return the share count.
If you want to roll up all of these into a single jQuery plugin check out Sharrre
Many of these API calls and methods are undocumented, so anticipate that they will change in the future. Also, if you are planning on rolling these out across a site I would recommend creating a simple endpoint that periodically caches results from all of the APIs so that you are not overloading the services will requests.
This is a simple way to backup your MySQL tables to Amazon S3 for a nightly backup - this is all to be done on your server :-)
Sister Document - Restore MySQL from Amazon S3 - read that next
this is for Centos 5.6, see http://s3tools.org/repositories for other systems like ubuntu etc