Greetings Front-end hopeful.
We would like you to spend no more than 4 hours of happy fun time turning a payload like this:
{
"value": 34,
"min": 0,
"max": 200,
"format": "currency",
var multiline = function (fn) { | |
var reCommentContents = /\/\*\s*([\s\S]*?)\s*\*\//; | |
return reCommentContents.exec(fn.toString())[1]; | |
}; | |
var html = multiline(function(){/* | |
<div> | |
<marquee>HELLO</marquee> | |
</div> | |
*/}); |
// useful if you are injecting code into 3rd party websites that may already have Keen | |
// this code will use the Keen SDK on the page if found, or initialize it's own otherwise. | |
// this approach will work in the average case, but could break if the 3rd party website | |
// is modifying or configuring the Keen library in an unexpected way | |
// a more durable approach would be to use an iFrame containing only the SDK and pass it messages | |
var context = this; | |
var myKeenClient = null; |
Greetings Front-end hopeful.
We would like you to spend no more than 4 hours of happy fun time turning a payload like this:
{
"value": 34,
"min": 0,
"max": 200,
"format": "currency",
# Path to boto config file, needed by gsutils | |
BOTO_CONFIG="/etc/boto.cfg" | |
# Path in which to create the backup (will get cleaned later) | |
BACKUP_PATH="/mnt/data/dump/" | |
# DB name | |
DB_NAME="mydatabase" | |
# Google Cloud Storage Bucket Name |
# Be sure to save your config files. Optional but I do: | |
sudo cp /etc/postgresql/9.3/main/postgresql.conf ~ | |
sudo cp /etc/postgresql/9.3/main/pg_hba.conf ~ | |
# Package repo (for apt-get) | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" >> /etc/apt/sources.list.d/postgresql.list' | |
# Also probably optional but I like to update sources and upgrade | |
sudo apt-get update |
<html> | |
<head> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/rgbcolor.js"></script> | |
<script type="text/javascript" src="http://canvg.googlecode.com/svn/trunk/canvg.js"></script> | |
<script> | |
function getImgData(chartContainer) { | |
var chartArea = chartContainer.getElementsByTagName('iframe')[0]. | |
contentDocument.getElementById('chartArea'); | |
var svg = chartArea.innerHTML; | |
var doc = chartContainer.ownerDocument; |
// http://jsfiddle.net/suBPQ/ | |
$.ajax({ | |
url: "http://api_test_server.proudlygeek.c9.io/", | |
success: function(data) { | |
console.log(data); | |
} | |
}); |
# Create your superuser | |
$ mongo | |
> use admin | |
> db.createUser({user:"someadmin",pwd:"secret", roles:[{role:"root",db:"admin"}]}) | |
> exit | |
# Alias for convenience (optional and at your own risk) | |
$ echo 'alias mongo="mongo --port 27017 -u someadmin -p secret --authenticationDatabase admin"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
module.exports = { | |
/** | |
* | |
* Using raw socket.io functionality from a Sails.js controller | |
* | |
*/ | |
index: function (req,res) { |