Skip to content

Instantly share code, notes, and snippets.

View boo1ean's full-sized avatar
🎯
Focusing

Єgor Gumeniuk boo1ean

🎯
Focusing
View GitHub Profile
@boo1ean
boo1ean / pg-table-sizes.sql
Created February 3, 2014 13:37
Get tables sizes for postgresql
SELECT nspname || '.' || relname AS "relation",
pg_size_pretty(pg_relation_size(C.oid)) AS "size"
FROM pg_class C
LEFT JOIN pg_namespace N ON (N.oid = C.relnamespace)
WHERE nspname NOT IN ('pg_catalog', 'information_schema')
ORDER BY pg_relation_size(C.oid) DESC
LIMIT 20;
var casual = require('casual'),
service = require('../real-service');
descibe('Some sort of service', function() {
it('Should not fail', function() {
var string = casual.string;
var expected = string + 'A';
var result = service.appendLetterAtoEndOfString(string);
result.should.be.exactly(expected);
shim: {
'jquery': {
path: 'public/vendor/jquery/jquery.js',
exports: '$'
},
'underscore': {
path: 'public/vendor/lodash/dist/lodash',
exports: '_'
},
'backbone': {
define(["marionette", "underscore"],
function(Marionette, _) {
return Marionette.AppRouter.extend({
appRoutes: {},
initialize: function(modules) {
this.appRoutes = _.extend.apply(null, _.pluck(modules, "appRoutes"));
this.controller = _.extend.apply(null, _.pluck(modules, "actions"));
this.listenTo(app, "navigate", function(location, force) {
if (force) {
define(["marionette", "underscore"], function(Marionette, _) {
return Marionette.Controller.extend({
mixins: [],
initialize: function(options) {
this.mixinModules();
this.m = {}; // Module models
this.c = {}; // Module collections
this.v = {}; // Modules views
var http = require('http'),
httpProxy = require('http-proxy');
var proxy = new httpProxy.createProxyServer();
http.createServer(function (req, res) {
proxy.web(req, res, {
target: req.url
});
}).listen(8000);
function EQUALS(y) {
if (IS_STRING(this) && IS_STRING(y)) return %StringEquals(this, y);
var x = this;
while (true) {
if (IS_NUMBER(x)) {
while (true) {
if (IS_NUMBER(y)) return %NumberEquals(x, y);
if (IS_NULL_OR_UNDEFINED(y)) return 1; // not equal
if (!IS_SPEC_OBJECT(y)) {
Math.random = (function() {
var seed = 49734321;
return function() {
// Robert Jenkins' 32 bit integer hash function.
seed = ((seed + 0x7ed55d16) + (seed << 12)) & 0xffffffff;
seed = ((seed ^ 0xc761c23c) ^ (seed >>> 19)) & 0xffffffff;
seed = ((seed + 0x165667b1) + (seed << 5)) & 0xffffffff;
seed = ((seed + 0xd3a2646c) ^ (seed << 9)) & 0xffffffff;
seed = ((seed + 0xfd7046c5) + (seed << 3)) & 0xffffffff;
seed = ((seed ^ 0xb55a4f09) ^ (seed >>> 16)) & 0xffffffff;
function JSONStringify(value, replacer, space) {
if (%_ArgumentsLength() == 1) {
var builder = new InternalArray();
BasicJSONSerialize('', value, new InternalArray(), builder);
if (builder.length == 0) return;
var result = %_FastAsciiArrayJoin(builder, "");
if (!IS_UNDEFINED(result)) return result;
return %StringBuilderConcat(builder, builder.length, "");
}
if (IS_OBJECT(space)) {