Skip to content

Instantly share code, notes, and snippets.

View EvAlex's full-sized avatar

Alexander Pavlyuk EvAlex

  • Qoollo
  • Moscow, The Russian Federation
View GitHub Profile
@rctay
rctay / ng.scenario.Describe.beforeAll.js
Last active December 19, 2015 01:08
angular.scenario: add beforeAll
/**
* Defines a block to execute before each it or nested describe.
*
* beforeAll()s will be called before beforeEach()s.
*
* Note: unlike beforeEach(), this needs to be called on "this", ie.
*
* this.beforeAll(...)
*
* This can be fixed but would require too much hacking.
@p1nox
p1nox / postgresql_configuration_on_ubuntu_for_rails.md
Last active November 29, 2023 04:38
PostgreSQL configuration without password on Ubuntu for Rails

Abstract

You could have postgre installed on localhost with password (or without user or password seted after instalation) but if we are developing we really don't need password, so configuring postgre server without password for all your rails project is usefull.

Install Postgre packages

  • postgresql
  • postgresql-client
  • libpq-dev
@thomseddon
thomseddon / gist:3511330
Last active March 8, 2023 03:39
AngularJS byte format filter
app.filter('bytes', function() {
return function(bytes, precision) {
if (isNaN(parseFloat(bytes)) || !isFinite(bytes)) return '-';
if (typeof precision === 'undefined') precision = 1;
var units = ['bytes', 'kB', 'MB', 'GB', 'TB', 'PB'],
number = Math.floor(Math.log(bytes) / Math.log(1024));
return (bytes / Math.pow(1024, Math.floor(number))).toFixed(precision) + ' ' + units[number];
}
});
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/