This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Generators ideas | |
- category | |
- dollar | |
- gender | |
- age | |
- array_of stuff | |
## db util | |
## gossip server (monitoring) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
angular.module('fitApp', ['ngRoute']). | |
config(['$routeProvider', '$locationProvider', function($routeProvider, $locationProvider) { | |
$routeProvider. | |
when('/', { | |
templateUrl: 'partials/index.html', | |
controller: IndexCtrl | |
}). | |
when('/exercises', { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var test = test(); | |
var login = function(credentials) { | |
return test() | |
.post('/login', credentials); | |
}; | |
var createAffiliate = test() | |
.post('/affiliates', casual.affiliate) | |
.as('affiliate') |
# Remove all stopped containers
docker rm $(docker ps -a -q)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var titles = ['день', 'дня', 'дней']; | |
var right_word = function (number) { | |
cases = [2, 0, 1, 1, 1, 2]; | |
return titles[(number % 100 > 4 && number % 100 < 20) ? 2 : cases[(number %10 < 5) ? number % 10 : 5]]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cats = require('services/cats'); | |
var dogs = require('services/dogs'); | |
var doStuff = function(data) { | |
whether(data.doge).then(function() { | |
return dogs.create(data).then(function(doge) { | |
data.doge_id = doge.id; | |
}); | |
}).then(function() { | |
return cats.create(data); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var fs = require('fs'); | |
var c = {}; | |
fs.readFile('ips', function(err, data) { | |
var ips = data.toString().split('\n'); | |
for (var i in ips) { | |
if (!c[ips[i]]) { | |
c[ips[i]] = 1 |
OlderNewer