CREATE EXTENSION pg_buffercache;
select usagecount, count(*), isdirty from pg_buffercache
group by isdirty, usagecount order by isdirty, usagecount;
usagecount | count | isdirty
CREATE EXTENSION pg_buffercache;
select usagecount, count(*), isdirty from pg_buffercache
group by isdirty, usagecount order by isdirty, usagecount;
usagecount | count | isdirty
Use ng-cloak
directive to hide interpolation tags {{}}
in index.html
Ex: <body ng-cloack>
And use ng-bind
instead of interpolation to avoid showing {{}}
. Ex: <span ng-bind="ctrl.value">?</span>
Overview: | |
This was an example I have given to my co-developer who was doing some Task/Coodinator type of code. Hope this is helpful to many other developers out there. | |
Note that the example only supports one-to-one dependency between TaskObject instance. The TaskAbstract class can be easily modified to support 1-to-many dependency. | |
For simpicity, I have combined all three classes in this single gist: | |
1. TaskAbstract | |
2. TaskObject (extends TaskAbstract) | |
3. TaskCoordinator (extends TaskAbstract) |
//prototypal inheritance | |
var human = { | |
species: "human", | |
create: function(values) { | |
var instance = Object.create(this); | |
Object.keys(values).forEach(function(key) { | |
instance[key] = values[key]; | |
}); | |
return instance; | |
}, |
// Classical prototypal inheritance | |
// This function comes from Node.js | |
function inherits(ctor, superCtor) { | |
ctor.super_ = superCtor; | |
ctor.prototype = Object.create(superCtor.prototype, { | |
constructor: { | |
value: ctor, | |
enumerable: false, | |
writable: true, |
var people = (function(){ | |
var people = ['Will', 'Steve']; | |
//cache DOM | |
var $el = $('#peopleModule'); | |
var $button = $el.find('button'); | |
var $input = $el.find('input'); | |
var $ul = $el.find('ul'); | |
var template = $el.find('#people-template').html(); |
//events - a super-basic Javascript (publish subscribe) pattern | |
var events = { | |
events: {}, | |
on: function (eventName, fn) { | |
this.events[eventName] = this.events[eventName] || []; | |
this.events[eventName].push(fn); | |
}, | |
off: function(eventName, fn) { | |
if (this.events[eventName]) { |
<?php | |
/* | |
* Converts CSV to JSON | |
* Example uses Google Spreadsheet CSV feed | |
* csvToArray function I think I found on php.net | |
*/ | |
header('Content-type: application/json'); | |
// Set your CSV feed |
################################################ | |
# This should install cartodb (development mode) | |
# in your Ubuntu 12.04 machine | |
################################################ | |
#!/bin/bash | |
sudo apt-get update | |
sudo apt-get safe-upgrade -y | |
# git:// port might be closed |
apt-get install freetds-dev | |
apt-get install libsybdb5 freetds-dev freetds-common | |
apt-get install postgresql-server-dev-9.3 | |
apt-get install git | |
git clone https://github.com/GeoffMontee/tds_fdw.git | |
cd tds_fdw/ | |
apt-get install build-essential | |
PATH=/usr/lib/postgresql/9.3/bin/:$PATH USE_PGXS=1 make | |
PATH=/usr/lib/postgresql/9.3/bin/:$PATH USE_PGXS=1 make install |